4 package CPAN::Meta::Feature;
5 our $VERSION = '2.140630'; # VERSION
7 use CPAN::Meta::Prereqs;
11 # A CPAN::Meta::Feature object describes an optional feature offered by a CPAN
12 # distribution and specified in the distribution's F<META.json> (or F<META.yml>)
15 # For the most part, this class will only be used when operating on the result of
16 # the C<feature> or C<features> methods on a L<CPAN::Meta> object.
20 # my $feature = CPAN::Meta::Feature->new( $identifier => \%spec );
22 # This returns a new Feature object. The C<%spec> argument to the constructor
23 # should be the same as the value of the C<optional_feature> entry in the
24 # distmeta. It must contain entries for C<description> and C<prereqs>.
29 my ($class, $identifier, $spec) = @_;
32 identifier => $identifier,
33 description => $spec->{description},
34 prereqs => CPAN::Meta::Prereqs->new($spec->{prereqs}),
37 bless \%guts => $class;
42 # This method returns the feature's identifier.
46 sub identifier { $_[0]{identifier} }
50 # This method returns the feature's long description.
54 sub description { $_[0]{description} }
58 # This method returns the feature's prerequisites as a L<CPAN::Meta::Prereqs>
63 sub prereqs { $_[0]{prereqs} }
67 # ABSTRACT: an optional feature provided by a CPAN distribution
77 CPAN::Meta::Feature - an optional feature provided by a CPAN distribution
85 A CPAN::Meta::Feature object describes an optional feature offered by a CPAN
86 distribution and specified in the distribution's F<META.json> (or F<META.yml>)
89 For the most part, this class will only be used when operating on the result of
90 the C<feature> or C<features> methods on a L<CPAN::Meta> object.
96 my $feature = CPAN::Meta::Feature->new( $identifier => \%spec );
98 This returns a new Feature object. The C<%spec> argument to the constructor
99 should be the same as the value of the C<optional_feature> entry in the
100 distmeta. It must contain entries for C<description> and C<prereqs>.
104 This method returns the feature's identifier.
108 This method returns the feature's long description.
112 This method returns the feature's prerequisites as a L<CPAN::Meta::Prereqs>
117 Please report any bugs or feature using the CPAN Request Tracker.
118 Bugs can be submitted through the web interface at
119 L<http://rt.cpan.org/Dist/Display.html?Queue=CPAN-Meta>
121 When submitting a bug or request, please include a test-file or a patch to an
122 existing test-file that illustrates the bug or desired feature.
130 David Golden <dagolden@cpan.org>
134 Ricardo Signes <rjbs@cpan.org>
138 =head1 COPYRIGHT AND LICENSE
140 This software is copyright (c) 2010 by David Golden and Ricardo Signes.
142 This is free software; you can redistribute it and/or modify it under
143 the same terms as the Perl 5 programming language system itself.