| 1 | 22 | ▶ | use 5.008001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 22 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 22 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | package CPAN::Meta::Feature; | ||
| 5 | |||
| 6 | 22 | our $VERSION = '2.150015'; | |
| 7 | |||
| 8 | 22 | ▶ | use CPAN::Meta::Prereqs; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 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<META.json> (or F<META.yml>) | ||
| 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<feature> or C<features> methods on a L<CPAN::Meta> 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<optional_feature> entry in the | ||
| 25 | #pod distmeta. It must contain entries for C<description> and C<prereqs>. | ||
| 26 | #pod | ||
| 27 | #pod =cut | ||
| 28 | |||
| 29 | 3 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||
| 30 | 3 | my ($class, $identifier, $spec) = @_; | |
| 31 | |||
| 32 | my %guts = ( | ||
| 33 | identifier => $identifier, | ||
| 34 | description => $spec->{description}, | ||
| 35 | 3 | prereqs => CPAN::Meta::Prereqs->new($spec->{prereqs}), | |
| 36 | ); | ||
| 37 | |||
| 38 | 3 | 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 | ▶ | sub identifier { $_[0]{identifier} } |
|
Subroutine
identifier: called CC=1 SCAR=0.0
Pod
documented
| |||
| 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 | ▶ | sub description { $_[0]{description} } |
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
documented
| |||
| 56 | |||
| 57 | #pod =method prereqs | ||
| 58 | #pod | ||
| 59 | #pod This method returns the feature's prerequisites as a L<CPAN::Meta::Prereqs> | ||
| 60 | #pod object. | ||
| 61 | #pod | ||
| 62 | #pod =cut | ||
| 63 | |||
| 64 | 3 | ▶ | sub prereqs { $_[0]{prereqs} } |
|
Subroutine
prereqs: called CC=1 SCAR=0.0
Pod
documented
| |||
| 65 | |||
| 66 | 22 | 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.150015 | ||
| 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<META.json> (or F<META.yml>) | ||
| 86 | file. | ||
| 87 | |||
| 88 | For the most part, this class will only be used when operating on the result of | ||
| 89 | the C<feature> or C<features> methods on a L<CPAN::Meta> 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<optional_feature> entry in the | ||
| 99 | distmeta. It must contain entries for C<description> and C<prereqs>. | ||
| 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<CPAN::Meta::Prereqs> | ||
| 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<http://rt.cpan.org/Dist/Display.html?Queue=CPAN-Meta> | ||
| 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 <dagolden@cpan.org> | ||
| 130 | |||
| 131 | =item * | ||
| 132 | |||
| 133 | Ricardo Signes <cpan@semiotic.systems> | ||
| 134 | |||
| 135 | =item * | ||
| 136 | |||
| 137 | Adam Kennedy <adamk@cpan.org> | ||
| 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__ | ||