File Coverage

lib/Net/API/CPAN/Changes/Release.pm
Criterion Covered Total %
statement 34 35 97.1
branch 5 10 50.0
condition n/a
subroutine 12 13 92.3
pod 6 6 100.0
total 57 64 89.0


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Meta CPAN API - ~/lib/Net/API/CPAN/Changes/Release.pm
3             ## Version v0.1.0
4             ## Copyright(c) 2023 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2023/07/25
7             ## Modified 2023/09/25
8             ## All rights reserved
9             ##
10             ##
11             ## This program is free software; you can redistribute it and/or modify it
12             ## under the same terms as Perl itself.
13             ##----------------------------------------------------------------------------
14             # This module file has been automatically generated. Any change made here will be lost.
15             # Edit the script in ./build/build_modules.pl instead
16             package Net::API::CPAN::Changes::Release;
17             BEGIN
18             {
19 2     2   240855 use strict;
  2         10  
  2         56  
20 2     2   9 use warnings;
  2         4  
  2         51  
21 2     2   9 use parent qw( Net::API::CPAN::Generic );
  2         4  
  2         10  
22 2     2   99 use vars qw( $VERSION );
  2         3  
  2         77  
23 2     2   31 our $VERSION = 'v0.1.0';
24             };
25              
26 2     2   8 use strict;
  2         3  
  2         31  
27 2     2   7 use warnings;
  2         4  
  2         472  
28              
29             sub init
30             {
31 1     1 1 9661 my $self = shift( @_ );
32 1 50       79 $self->{author} = undef unless( CORE::exists( $self->{author} ) );
33 1 50       5 $self->{changes_file} = undef unless( CORE::exists( $self->{changes_file} ) );
34 1 50       5 $self->{changes_text} = undef unless( CORE::exists( $self->{changes_text} ) );
35 1         3 $self->{object} = 'changes_release';
36 1 50       4 $self->{release} = undef unless( CORE::exists( $self->{release} ) );
37 1         2 $self->{_init_strict_use_sub} = 1;
38 1         2 $self->{_exception_class} = 'Net::API::CPAN::Exception';
39 1 50       13 $self->SUPER::init( @_ ) || return( $self->pass_error );
40 1         7 $self->{fields} = [qw( author changes_file changes_text release )];
41 1         3 return( $self );
42             }
43              
44 2     2 1 3779 sub author { return( shift->_set_get_scalar_as_object( 'author', @_ ) ); }
45              
46 2     2 1 2387 sub changes_file { return( shift->_set_get_scalar_as_object( 'changes_file', @_ ) ); }
47              
48 2     2 1 60813 sub changes_text { return( shift->_set_get_scalar_as_object( 'changes_text', @_ ) ); }
49              
50 0     0 1 0 sub object { return( shift->_set_get_scalar_as_object( 'object', @_ ) ); }
51              
52 2     2 1 2401 sub release { return( shift->_set_get_scalar_as_object( 'release', @_ ) ); }
53              
54             1;
55             # NOTE: POD
56             __END__
57              
58             =encoding utf-8
59              
60             =head1 NAME
61              
62             Net::API::CPAN::Changes::Release - Meta CPAN API Changes::Release Class
63              
64             =head1 SYNOPSIS
65              
66             use Net::API::CPAN::Changes::Release;
67             my $obj = Net::API::CPAN::Changes::Release->new( {
68             author => "MOMOTARO",
69             changes_file => "CHANGES",
70             changes_text => "Revision history for Perl module Folklore::Japan\n\nv1.2.3 2023-07-29T09:12:10+0900\n - Initial release\n",
71             release => "Folklore-Japan-v1.2.3",
72             } ) || die( Net::API::CPAN::Changes::Release->error );
73            
74             my $string = $obj->author;
75             my $string = $obj->changes_file;
76             my $string = $obj->changes_text;
77             my $str = $obj->object;
78             my $string = $obj->release;
79              
80             =head1 VERSION
81              
82             v0.1.0
83              
84             =head1 DESCRIPTION
85              
86             This class serves to retrieve and manipulate changes_releases.
87              
88             It inherits from L<Net::API::CPAN::Generic>
89              
90             =head1 CONSTRUCTOR
91              
92             =head2 new
93              
94             Provided with an hash or hash reference of parameters, and this instantiates a new C<Net::API::CPAN::Changes::Release> object.
95              
96             The parameters that can be provided bear the same name and supports the same values as the methods below.
97              
98             =head1 METHODS
99              
100             =head2 author
101              
102             $obj->author( "MOMOTARO" );
103             my $string = $obj->author;
104              
105             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
106              
107             =head2 changes_file
108              
109             $obj->changes_file( "CHANGES" );
110             my $string = $obj->changes_file;
111              
112             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
113              
114             =head2 changes_text
115              
116             $obj->changes_text( "Revision history for Perl module Folklore::Japan\n\nv1.2.3 2023-07-29T09:12:10+0900\n - Initial release\n" );
117             my $string = $obj->changes_text;
118              
119             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
120              
121             =head2 object
122              
123             Returns the object type for this class, which is C<changes_release>
124              
125             =head2 release
126              
127             $obj->release( "Folklore-Japan-v1.2.3" );
128             my $string = $obj->release;
129              
130             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
131              
132             =head1 API SAMPLE
133              
134             {
135             "author" : "MOMOTARO",
136             "changes_file" : "CHANGES",
137             "changes_text" : "Revision history for Perl module Folklore::Japan\n\nv1.2.3 2023-07-29T09:12:10+0900\n - Initial release\n",
138             "release" : "Folklore-Japan-v1.2.3"
139             }
140              
141             =head1 AUTHOR
142              
143             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
144              
145             =head1 SEE ALSO
146              
147             L<Net::API::CPAN>, L<Net::API::CPAN::Activity>, L<Net::API::CPAN::Author>, L<Net::API::CPAN::Changes>, L<Net::API::CPAN::Changes::Release>, L<Net::API::CPAN::Contributor>, L<Net::API::CPAN::Cover>, L<Net::API::CPAN::Diff>, L<Net::API::CPAN::Distribution>, L<Net::API::CPAN::DownloadUrl>, L<Net::API::CPAN::Favorite>, L<Net::API::CPAN::File>, L<Net::API::CPAN::Module>, L<Net::API::CPAN::Package>, L<Net::API::CPAN::Permission>, L<Net::API::CPAN::Rating>, L<Net::API::CPAN::Release>
148              
149             L<MetaCPAN::API>, L<MetaCPAN::Client>
150              
151             L<https://github.com/metacpan/metacpan-api/blob/master/docs/API-docs.md>
152              
153             =head1 COPYRIGHT & LICENSE
154              
155             Copyright(c) 2023 DEGUEST Pte. Ltd.
156              
157             All rights reserved
158              
159             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
160              
161             =cut
162