lib/Net/API/CPAN/Permission.pm

filter: Statementstmt 97.0% 33 / 34 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 91.6% 11 / 12 Podpod 100% 5 / 5 totaltotal 89.8% 53 / 59 CC 5 SCAR 8.7
CC
5
Cov
88%
init
5.3
object
2.0
BEGIN
1.0
CRAP 2.4
« lib/Net/API/CPAN/Mirrors.pm ↑ Summary blib/lib/Net/API/CPAN/Exception.pm »
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 2 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶ use parent qw( Net::API::CPAN::Generic );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶ our $VERSION = 'v0.1.0';
Subroutine BEGIN: called CC=1 SCAR=0.0
24 };
25  
26 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 sub init
30 {
31 1 ▶ my $self = shift( @_ );
Subroutine init: called CC=5 SCAR=16.6
Pod documented
32 1 ▶ $self->{co_maintainers} = [] unless( CORE::exists( $self->{co_maintainers} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"co_maintainers"} 1 0 1
33 1 ▶ $self->{module_name} = undef unless( CORE::exists( $self->{module_name} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"module_name"} 1 0 1
34 1 $self->{object} = 'permission';
35 1 ▶ $self->{owner} = undef unless( CORE::exists( $self->{owner} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"owner"} 1 0 1
36 1 $self->{_init_strict_use_sub} = 1;
37 1 $self->{_exception_class} = 'Net::API::CPAN::Exception';
38 1 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 1 1
39 1 $self->{fields} = [qw( co_maintainers module_name owner )];
40 1 return( $self );
41 }
42  
43 2 ▶sub co_maintainers { return( shift->_set_get_array_as_object( 'co_maintainers', @_ ) ); }
Subroutine co_maintainers: called CC=1 SCAR=0.0
Pod documented
44  
45 2 ▶sub module_name { return( shift->_set_get_scalar_as_object( 'module_name', @_ ) ); }
Subroutine module_name: called CC=1 SCAR=0.0
Pod documented
46  
47 0 ▶sub object { return( shift->_set_get_scalar_as_object( 'object', @_ ) ); }
Subroutine object: not called CC=1 SCAR=6.9
Pod documented
48  
49 2 ▶sub owner { return( shift->_set_get_scalar_as_object( 'owner', @_ ) ); }
Subroutine owner: called CC=1 SCAR=0.0
Pod documented
50  
51 2 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  
« lib/Net/API/CPAN/Mirrors.pm ↑ Summary blib/lib/Net/API/CPAN/Exception.pm »