Filename | C:/tmp64ng/perl/lib/CPAN/Meta/Feature.pm |
Statements | Executed 10 statements in 0s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 0s | 0s | BEGIN@1 | CPAN::Meta::
1 | 1 | 1 | 0s | 0s | BEGIN@2 | CPAN::Meta::
1 | 1 | 1 | 0s | 0s | BEGIN@3 | CPAN::Meta::
1 | 1 | 1 | 0s | 0s | BEGIN@7 | CPAN::Meta::Feature::
0 | 0 | 0 | 0s | 0s | description | CPAN::Meta::Feature::
0 | 0 | 0 | 0s | 0s | identifier | CPAN::Meta::Feature::
0 | 0 | 0 | 0s | 0s | new | CPAN::Meta::Feature::
0 | 0 | 0 | 0s | 0s | prereqs | CPAN::Meta::Feature::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 0s | 1 | 0s | # spent 0s within CPAN::Meta::BEGIN@1 which was called:
# once (0s+0s) by CPAN::Meta::BEGIN@56 at line 1 # spent 0s making 1 call to CPAN::Meta::BEGIN@1 |
2 | 2 | 0s | 2 | 0s | # spent 0s within CPAN::Meta::BEGIN@2 which was called:
# once (0s+0s) by CPAN::Meta::BEGIN@56 at line 2 # spent 0s making 1 call to CPAN::Meta::BEGIN@2
# spent 0s making 1 call to strict::import |
3 | 2 | 0s | 2 | 0s | # spent 0s within CPAN::Meta::BEGIN@3 which was called:
# once (0s+0s) by CPAN::Meta::BEGIN@56 at line 3 # spent 0s making 1 call to CPAN::Meta::BEGIN@3
# spent 0s making 1 call to warnings::import |
4 | package CPAN::Meta::Feature; | ||||
5 | # VERSION | ||||
6 | 1 | 0s | $CPAN::Meta::Feature::VERSION = '2.143240'; | ||
7 | 2 | 0s | 1 | 0s | # spent 0s within CPAN::Meta::Feature::BEGIN@7 which was called:
# once (0s+0s) by CPAN::Meta::BEGIN@56 at line 7 # spent 0s making 1 call to CPAN::Meta::Feature::BEGIN@7 |
8 | |||||
9 | #pod =head1 DESCRIPTION | ||||
10 | #pod | ||||
11 | #pod A CPAN::Meta::Feature object describes an optional feature offered by a CPAN | ||||
12 | #pod distribution and specified in the distribution's F<META.json> (or F<META.yml>) | ||||
13 | #pod file. | ||||
14 | #pod | ||||
15 | #pod For the most part, this class will only be used when operating on the result of | ||||
16 | #pod the C<feature> or C<features> methods on a L<CPAN::Meta> object. | ||||
17 | #pod | ||||
18 | #pod =method new | ||||
19 | #pod | ||||
20 | #pod my $feature = CPAN::Meta::Feature->new( $identifier => \%spec ); | ||||
21 | #pod | ||||
22 | #pod This returns a new Feature object. The C<%spec> argument to the constructor | ||||
23 | #pod should be the same as the value of the C<optional_feature> entry in the | ||||
24 | #pod distmeta. It must contain entries for C<description> and C<prereqs>. | ||||
25 | #pod | ||||
26 | #pod =cut | ||||
27 | |||||
28 | sub new { | ||||
29 | my ($class, $identifier, $spec) = @_; | ||||
30 | |||||
31 | my %guts = ( | ||||
32 | identifier => $identifier, | ||||
33 | description => $spec->{description}, | ||||
34 | prereqs => CPAN::Meta::Prereqs->new($spec->{prereqs}), | ||||
35 | ); | ||||
36 | |||||
37 | bless \%guts => $class; | ||||
38 | } | ||||
39 | |||||
40 | #pod =method identifier | ||||
41 | #pod | ||||
42 | #pod This method returns the feature's identifier. | ||||
43 | #pod | ||||
44 | #pod =cut | ||||
45 | |||||
46 | sub identifier { $_[0]{identifier} } | ||||
47 | |||||
48 | #pod =method description | ||||
49 | #pod | ||||
50 | #pod This method returns the feature's long description. | ||||
51 | #pod | ||||
52 | #pod =cut | ||||
53 | |||||
54 | sub description { $_[0]{description} } | ||||
55 | |||||
56 | #pod =method prereqs | ||||
57 | #pod | ||||
58 | #pod This method returns the feature's prerequisites as a L<CPAN::Meta::Prereqs> | ||||
59 | #pod object. | ||||
60 | #pod | ||||
61 | #pod =cut | ||||
62 | |||||
63 | sub prereqs { $_[0]{prereqs} } | ||||
64 | |||||
65 | 1 | 0s | 1; | ||
66 | |||||
67 | # ABSTRACT: an optional feature provided by a CPAN distribution | ||||
68 | |||||
69 | __END__ |