File Coverage

blib/lib/CPAN/Meta/Feature.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 4 4 100.0
total 29 29 100.0


line stmt bran cond sub pod time code
1 12     12   144 use 5.006;
  12         26  
2 12     12   34 use strict;
  12         13  
  12         243  
3 12     12   37 use warnings;
  12         11  
  12         478  
4             package CPAN::Meta::Feature;
5              
6             our $VERSION = '2.150009'; # TRIAL
7              
8 12     12   4284 use CPAN::Meta::Prereqs;
  12         21  
  12         1330  
9              
10             #pod =head1 DESCRIPTION
11             #pod
12             #pod A CPAN::Meta::Feature object describes an optional feature offered by a CPAN
13             #pod distribution and specified in the distribution's F (or F)
14             #pod file.
15             #pod
16             #pod For the most part, this class will only be used when operating on the result of
17             #pod the C or C methods on a L object.
18             #pod
19             #pod =method new
20             #pod
21             #pod my $feature = CPAN::Meta::Feature->new( $identifier => \%spec );
22             #pod
23             #pod This returns a new Feature object. The C<%spec> argument to the constructor
24             #pod should be the same as the value of the C entry in the
25             #pod distmeta. It must contain entries for C and C.
26             #pod
27             #pod =cut
28              
29             sub new {
30 3     3 1 4 my ($class, $identifier, $spec) = @_;
31              
32             my %guts = (
33             identifier => $identifier,
34             description => $spec->{description},
35 3         10 prereqs => CPAN::Meta::Prereqs->new($spec->{prereqs}),
36             );
37              
38 3         12 bless \%guts => $class;
39             }
40              
41             #pod =method identifier
42             #pod
43             #pod This method returns the feature's identifier.
44             #pod
45             #pod =cut
46              
47 2     2 1 685 sub identifier { $_[0]{identifier} }
48              
49             #pod =method description
50             #pod
51             #pod This method returns the feature's long description.
52             #pod
53             #pod =cut
54              
55 2     2 1 8 sub description { $_[0]{description} }
56              
57             #pod =method prereqs
58             #pod
59             #pod This method returns the feature's prerequisites as a L
60             #pod object.
61             #pod
62             #pod =cut
63              
64 3     3 1 16 sub prereqs { $_[0]{prereqs} }
65              
66             1;
67              
68             # ABSTRACT: an optional feature provided by a CPAN distribution
69              
70             =pod
71              
72             =encoding UTF-8
73              
74             =head1 NAME
75              
76             CPAN::Meta::Feature - an optional feature provided by a CPAN distribution
77              
78             =head1 VERSION
79              
80             version 2.150009
81              
82             =head1 DESCRIPTION
83              
84             A CPAN::Meta::Feature object describes an optional feature offered by a CPAN
85             distribution and specified in the distribution's F (or F)
86             file.
87              
88             For the most part, this class will only be used when operating on the result of
89             the C or C methods on a L object.
90              
91             =head1 METHODS
92              
93             =head2 new
94              
95             my $feature = CPAN::Meta::Feature->new( $identifier => \%spec );
96              
97             This returns a new Feature object. The C<%spec> argument to the constructor
98             should be the same as the value of the C entry in the
99             distmeta. It must contain entries for C and C.
100              
101             =head2 identifier
102              
103             This method returns the feature's identifier.
104              
105             =head2 description
106              
107             This method returns the feature's long description.
108              
109             =head2 prereqs
110              
111             This method returns the feature's prerequisites as a L
112             object.
113              
114             =head1 BUGS
115              
116             Please report any bugs or feature using the CPAN Request Tracker.
117             Bugs can be submitted through the web interface at
118             L
119              
120             When submitting a bug or request, please include a test-file or a patch to an
121             existing test-file that illustrates the bug or desired feature.
122              
123             =head1 AUTHORS
124              
125             =over 4
126              
127             =item *
128              
129             David Golden
130              
131             =item *
132              
133             Ricardo Signes
134              
135             =item *
136              
137             Adam Kennedy
138              
139             =back
140              
141             =head1 COPYRIGHT AND LICENSE
142              
143             This software is copyright (c) 2010 by David Golden, Ricardo Signes, Adam Kennedy and Contributors.
144              
145             This is free software; you can redistribute it and/or modify it under
146             the same terms as the Perl 5 programming language system itself.
147              
148             =cut
149              
150             __END__