blib/lib/Net/API/CPAN/Permission.pm untested

filter: Statementstmt 0.0% 0 / 35 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 12 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 61 CC 4 SCAR 19.2
CC
4
Cov
0%
init
20.0
BEGIN
2.0
co_maintainers
2.0
CRAP 6.8
1 ##----------------------------------------------------------------------------
2 ## Meta CPAN API - ~/lib/Net/API/CPAN/Permission.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/26
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::Permission;
17 BEGIN
18 {
19 use strict;
20 use warnings;
21 use parent qw( Net::API::CPAN::Generic );
22 use vars qw( $VERSION );
23 our $VERSION = 'v0.1.0';
24 };
25  
26 use strict;
27 use warnings;
28  
29 sub init
30 {
31 my $self = shift( @_ );
32 $self->{co_maintainers} = [] unless( CORE::exists( $self->{co_maintainers} ) );
33 $self->{module_name} = undef unless( CORE::exists( $self->{module_name} ) );
34 $self->{object} = 'permission';
35 $self->{owner} = undef unless( CORE::exists( $self->{owner} ) );
36 $self->{_init_strict_use_sub} = 1;
37 $self->{_exception_class} = 'Net::API::CPAN::Exception';
38 $self->SUPER::init( @_ ) || return( $self->pass_error );
39 $self->{fields} = [qw( co_maintainers module_name owner )];
40 return( $self );
41 }
42  
43 sub co_maintainers { return( shift->_set_get_array_as_object( 'co_maintainers', @_ ) ); }
44  
45 sub module_name { return( shift->_set_get_scalar_as_object( 'module_name', @_ ) ); }
46  
47 sub object { return( shift->_set_get_scalar_as_object( 'object', @_ ) ); }
48  
49 sub owner { return( shift->_set_get_scalar_as_object( 'owner', @_ ) ); }
50  
51 1;
52 # NOTE: POD
53 __END__
54  
55 =encoding utf-8
56  
57 =head1 NAME
58  
59 Net::API::CPAN::Permission - Meta CPAN API Permission Class
60  
61 =head1 SYNOPSIS
62  
63 use Net::API::CPAN::Permission;
64 my $obj = Net::API::CPAN::Permission->new( {
65 co_maintainers => [
66 "URASHIMATARO",
67 "KINTARO",
68 "YAMATONADESHIKO",
69 ],
70 module_name => "Folklore::Japan",
71 owner => "MOMOTARO",
72 } ) || die( Net::API::CPAN::Permission->error );
73
74 my $array = $obj->co_maintainers;
75 my $string = $obj->module_name;
76 my $str = $obj->object;
77 my $string = $obj->owner;
78  
79 =head1 VERSION
80  
81 v0.1.0
82  
83 =head1 DESCRIPTION
84  
85 This class serves to retrieve and manipulate permissions.
86  
87 It inherits from L<Net::API::CPAN::Generic>
88  
89 =head1 CONSTRUCTOR
90  
91 =head2 new
92  
93 Provided with an hash or hash reference of parameters, and this instantiates a new C<Net::API::CPAN::Permission> object.
94  
95 The parameters that can be provided bear the same name and supports the same values as the methods below.
96  
97 =head1 METHODS
98  
99 =head2 co_maintainers
100  
101 $obj->co_maintainers( [
102 "URASHIMATARO",
103 "KINTARO",
104 "YAMATONADESHIKO",
105 ] );
106 my $array = $obj->co_maintainers;
107  
108 Sets or gets an array of co_maintainers and returns an L<array object|Module::Generic::Array>, even if there is no value.
109  
110 =head2 module_name
111  
112 $obj->module_name( "Folklore::Japan" );
113 my $string = $obj->module_name;
114  
115 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
116  
117 =head2 object
118  
119 Returns the object type for this class, which is C<permission>
120  
121 =head2 owner
122  
123 $obj->owner( "MOMOTARO" );
124 my $string = $obj->owner;
125  
126 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
127  
128 =head1 API SAMPLE
129  
130 {
131 "co_maintainers" : [
132 "URASHIMATARO",
133 "KINTARO",
134 "YAMATONADESHIKO"
135 ],
136 "module_name" : "Folklore::Japan",
137 "owner" : "MOMOTARO"
138 }
139  
140 =head1 AUTHOR
141  
142 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
143  
144 =head1 SEE ALSO
145  
146 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>
147  
148 L<MetaCPAN::API>, L<MetaCPAN::Client>
149  
150 L<https://github.com/metacpan/metacpan-api/blob/master/docs/API-docs.md>
151  
152 =head1 COPYRIGHT & LICENSE
153  
154 Copyright(c) 2023 DEGUEST Pte. Ltd.
155  
156 All rights reserved
157  
158 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
159  
160 =cut
161