diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-08-29 04:48:18 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2014-08-29 04:48:18 +0000 |
commit | 6b1d736955543538c54f1d8033ce3bdcb175da91 (patch) | |
tree | f7f7e23929d493647c0e2f9b1a556d3101194538 /lib/Module/CPANfile/Requirement.pm | |
download | Module-CPANfile-tarball-master.tar.gz |
Module-CPANfile-1.1000HEADModule-CPANfile-1.1000master
Diffstat (limited to 'lib/Module/CPANfile/Requirement.pm')
-rw-r--r-- | lib/Module/CPANfile/Requirement.pm | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Module/CPANfile/Requirement.pm b/lib/Module/CPANfile/Requirement.pm new file mode 100644 index 0000000..01c6358 --- /dev/null +++ b/lib/Module/CPANfile/Requirement.pm @@ -0,0 +1,25 @@ +package Module::CPANfile::Requirement; +use strict; + +sub new { + my ($class, %args) = @_; + + $args{version} ||= 0; + + bless +{ + name => delete $args{name}, + version => delete $args{version}, + options => \%args, + }, $class; +} + +sub name { $_[0]->{name} } +sub version { $_[0]->{version} } + +sub options { $_[0]->{options} } + +sub has_options { + keys %{$_[0]->{options}} > 0; +} + +1; |