lib/Net/API/CPAN/File.pm

filter: Statementstmt 98.9% 91 / 92 Branchbran 98.4% 65 / 66 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 97.5% 40 / 41 Podpod 100% 34 / 34 totaltotal 98.7% 230 / 233 CC 34 SCAR 27.8
CC
34
Cov
99%
init
34.0
object
2.0
BEGIN
1.0
CRAP 16.2
« lib/Net/API/CPAN/Author.pm ↑ Summary blib/lib/Net/API/CPAN/Cover.pm »
1 ##----------------------------------------------------------------------------
2 ## Meta CPAN API - ~/lib/Net/API/CPAN/File.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::File;
17 BEGIN
18 {
19 4 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 4 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 4 ▶ use parent qw( Net::API::CPAN::Generic );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 4 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
23 4 ▶ our $VERSION = 'v0.1.0';
Subroutine BEGIN: called CC=1 SCAR=0.0
24 };
25  
26 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 sub init
30 {
31 3 ▶ my $self = shift( @_ );
Subroutine init: called CC=34 SCAR=35.3
Pod documented
32 3 ▶ $self->{abstract} = undef unless( CORE::exists( $self->{abstract} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"abstract"} 2 1 3
33 3 ▶ $self->{author} = [] unless( CORE::exists( $self->{author} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"author"} 1 2 3
34 3 ▶ $self->{authorized} = undef unless( CORE::exists( $self->{authorized} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"authorized"} 1 2 3
35 3 ▶ $self->{binary} = undef unless( CORE::exists( $self->{binary} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"binary"} 1 2 3
36 3 ▶ $self->{category} = undef unless( CORE::exists( $self->{category} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"category"} 2 1 3
37 3 ▶ $self->{date} = undef unless( CORE::exists( $self->{date} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"date"} 1 2 3
38 3 ▶ $self->{deprecated} = undef unless( CORE::exists( $self->{deprecated} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"deprecated"} 1 2 3
39 3 ▶ $self->{description} = undef unless( CORE::exists( $self->{description} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"description"} 2 1 3
40 3 ▶ $self->{dir} = undef unless( CORE::exists( $self->{dir} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"dir"} 2 1 3
41 3 ▶ $self->{directory} = undef unless( CORE::exists( $self->{directory} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"directory"} 1 2 3
42 3 ▶ $self->{dist_fav_count} = undef unless( CORE::exists( $self->{dist_fav_count} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"dist_fav_count"} 1 2 3
43 3 ▶ $self->{distribution} = undef unless( CORE::exists( $self->{distribution} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"distribution"} 1 2 3
44 3 ▶ $self->{documentation} = undef unless( CORE::exists( $self->{documentation} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"documentation"} 2 1 3
45 3 ▶ $self->{download_url} = undef unless( CORE::exists( $self->{download_url} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"download_url"} 1 2 3
46 3 ▶ $self->{id} = undef unless( CORE::exists( $self->{id} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"id"} 1 2 3
47 3 ▶ $self->{indexed} = undef unless( CORE::exists( $self->{indexed} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"indexed"} 1 2 3
48 3 ▶ $self->{level} = undef unless( CORE::exists( $self->{level} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"level"} 1 2 3
49 3 ▶ $self->{maturity} = undef unless( CORE::exists( $self->{maturity} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"maturity"} 1 2 3
50 3 ▶ $self->{mime} = undef unless( CORE::exists( $self->{mime} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"mime"} 1 2 3
51 3 ▶ $self->{module} = [] unless( CORE::exists( $self->{module} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"module"} 1 2 3
52 3 ▶ $self->{name} = undef unless( CORE::exists( $self->{name} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"name"} 1 2 3
53 3 $self->{object} = 'file';
54 3 ▶ $self->{path} = undef unless( CORE::exists( $self->{path} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"path"} 1 2 3
55 3 ▶ $self->{pod} = undef unless( CORE::exists( $self->{pod} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"pod"} 1 2 3
56 3 ▶ $self->{pod_lines} = [] unless( CORE::exists( $self->{pod_lines} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"pod_lines"} 1 2 3
57 3 ▶ $self->{release} = [] unless( CORE::exists( $self->{release} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"release"} 1 2 3
58 3 ▶ $self->{sloc} = undef unless( CORE::exists( $self->{sloc} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"sloc"} 1 2 3
59 3 ▶ $self->{slop} = undef unless( CORE::exists( $self->{slop} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"slop"} 1 2 3
60 3 ▶ $self->{stat} = undef unless( CORE::exists( $self->{stat} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"stat"} 1 2 3
61 3 ▶ $self->{status} = undef unless( CORE::exists( $self->{status} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"status"} 1 2 3
62 3 ▶ $self->{suggest} = undef unless( CORE::exists( $self->{suggest} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"suggest"} 2 1 3
63 3 ▶ $self->{version} = '' unless( CORE::exists( $self->{version} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"version"} 1 2 3
64 3 ▶ $self->{version_numified} = undef unless( CORE::exists( $self->{version_numified} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"version_numified"} 1 2 3
65 3 $self->{_init_strict_use_sub} = 1;
66 3 $self->{_exception_class} = 'Net::API::CPAN::Exception';
67 3 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 3 3
68 3 $self->{fields} = [qw(
69 abstract author authorized binary category date deprecated description dir
70 directory dist_fav_count distribution documentation download_url id indexed level
71 maturity mime module name path pod pod_lines release sloc slop stat status suggest
72 version version_numified
73 )];
74 3 return( $self );
75 }
76  
77 4 ▶sub abstract { return( shift->_set_get_scalar_as_object( 'abstract', @_ ) ); }
Subroutine abstract: called CC=1 SCAR=0.0
Pod documented
78  
79 6 ▶sub author { return( shift->_set_get_scalar_or_object( 'author', 'Net::API::CPAN::Author', @_ ) ); }
Subroutine author: called CC=1 SCAR=0.0
Pod documented
80  
81 6 ▶sub authorized { return( shift->_set_get_boolean( 'authorized', @_ ) ); }
Subroutine authorized: called CC=1 SCAR=0.0
Pod documented
82  
83 6 ▶sub binary { return( shift->_set_get_boolean( 'binary', @_ ) ); }
Subroutine binary: called CC=1 SCAR=0.0
Pod documented
84  
85 3 ▶sub category { return( shift->_set_get_scalar_as_object( 'category', @_ ) ); }
Subroutine category: called CC=1 SCAR=0.0
Pod documented
86  
87 6 ▶sub date { return( shift->_set_get_datetime( 'date', @_ ) ); }
Subroutine date: called CC=1 SCAR=0.0
Pod documented
88  
89 6 ▶sub deprecated { return( shift->_set_get_boolean( 'deprecated', @_ ) ); }
Subroutine deprecated: called CC=1 SCAR=0.0
Pod documented
90  
91 4 ▶sub description { return( shift->_set_get_scalar_as_object( 'description', @_ ) ); }
Subroutine description: called CC=1 SCAR=0.0
Pod documented
92  
93 2 ▶sub dir { return( shift->_set_get_scalar_as_object( 'dir', @_ ) ); }
Subroutine dir: called CC=1 SCAR=0.0
Pod documented
94  
95 6 ▶sub directory { return( shift->_set_get_boolean( 'directory', @_ ) ); }
Subroutine directory: called CC=1 SCAR=0.0
Pod documented
96  
97 5 ▶sub dist_fav_count { return( shift->_set_get_number( 'dist_fav_count', @_ ) ); }
Subroutine dist_fav_count: called CC=1 SCAR=0.0
Pod documented
98  
99 6 ▶sub distribution { return( shift->_set_get_scalar_as_object( 'distribution', @_ ) ); }
Subroutine distribution: called CC=1 SCAR=0.0
Pod documented
100  
101 4 ▶sub documentation { return( shift->_set_get_scalar_as_object( 'documentation', @_ ) ); }
Subroutine documentation: called CC=1 SCAR=0.0
Pod documented
102  
103 6 ▶sub download_url { return( shift->_set_get_uri( 'download_url', @_ ) ); }
Subroutine download_url: called CC=1 SCAR=0.0
Pod documented
104  
105 6 ▶sub id { return( shift->_set_get_scalar_as_object( 'id', @_ ) ); }
Subroutine id: called CC=1 SCAR=0.0
Pod documented
106  
107 6 ▶sub indexed { return( shift->_set_get_boolean( 'indexed', @_ ) ); }
Subroutine indexed: called CC=1 SCAR=0.0
Pod documented
108  
109 6 ▶sub level { return( shift->_set_get_number( 'level', @_ ) ); }
Subroutine level: called CC=1 SCAR=0.0
Pod documented
110  
111 6 ▶sub maturity { return( shift->_set_get_scalar_as_object( 'maturity', @_ ) ); }
Subroutine maturity: called CC=1 SCAR=0.0
Pod documented
112  
113 6 ▶sub mime { return( shift->_set_get_scalar_as_object( 'mime', @_ ) ); }
Subroutine mime: called CC=1 SCAR=0.0
Pod documented
114  
115 6 ▶sub module { return( shift->_set_get_class_array_object( 'module', {
Subroutine module: called CC=1 SCAR=0.0
Pod documented
116 associated_pod => "scalar_as_object",
117 authorized => "boolean",
118 indexed => "boolean",
119 name => "scalar_as_object",
120 version => "scalar_as_object",
121 version_numified => "number",
122 }, @_ ) ); }
123  
124 6 ▶sub name { return( shift->_set_get_scalar_as_object( 'name', @_ ) ); }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
125  
126 0 ▶sub object { return( shift->_set_get_scalar_as_object( 'object', @_ ) ); }
Subroutine object: not called CC=1 SCAR=6.9
Pod documented
127  
128 6 ▶sub path { return( shift->_set_get_scalar_as_object( 'path', @_ ) ); }
Subroutine path: called CC=1 SCAR=0.0
Pod documented
129  
130 6 ▶sub pod { return( shift->_set_get_scalar_as_object( 'pod', @_ ) ); }
Subroutine pod: called CC=1 SCAR=0.0
Pod documented
131  
132 6 ▶sub pod_lines { return( shift->_set_get_array_as_object( 'pod_lines', @_ ) ); }
Subroutine pod_lines: called CC=1 SCAR=0.0
Pod documented
133  
134 6 ▶sub release { return( shift->_set_get_scalar_or_object( 'release', 'Net::API::CPAN::Release', @_ ) ); }
Subroutine release: called CC=1 SCAR=0.0
Pod documented
135  
136 6 ▶sub sloc { return( shift->_set_get_number( 'sloc', @_ ) ); }
Subroutine sloc: called CC=1 SCAR=0.0
Pod documented
137  
138 6 ▶sub slop { return( shift->_set_get_number( 'slop', @_ ) ); }
Subroutine slop: called CC=1 SCAR=0.0
Pod documented
139  
140 6 ▶sub stat { return( shift->_set_get_class( 'stat', {
Subroutine stat: called CC=1 SCAR=0.0
Pod documented
141 gid => "integer",
142 mode => "integer",
143 mtime => "datetime",
144 size => "integer",
145 uid => "integer",
146 }, @_ ) ); }
147  
148 6 ▶sub status { return( shift->_set_get_scalar_as_object( 'status', @_ ) ); }
Subroutine status: called CC=1 SCAR=0.0
Pod documented
149  
150 4 ▶sub suggest { return( shift->_set_get_class( 'suggest', {
Subroutine suggest: called CC=1 SCAR=0.0
Pod documented
151 input => "array_as_object",
152 payload => "hash_as_object",
153 weight => "integer",
154 }, @_ ) ); }
155  
156 6 ▶sub version { return( shift->_set_get_version( { class => "Changes::Version", field => "version" }, @_ ) ); }
Subroutine version: called CC=1 SCAR=0.0
Pod documented
157  
158 6 ▶sub version_numified { return( shift->_set_get_number( 'version_numified', @_ ) ); }
Subroutine version_numified: called CC=1 SCAR=0.0
Pod documented
159  
160 4 1;
161 # NOTE: POD
162 __END__
163  
164 =encoding utf-8
165  
166 =head1 NAME
167  
168 Net::API::CPAN::File - Meta CPAN API File Class
169  
170 =head1 SYNOPSIS
171  
172 use Net::API::CPAN::File;
173 my $obj = Net::API::CPAN::File->new( {
174 abstract => "Japan Folklore Object Class",
175 author => "MOMOTARO",
176 authorized => \1,
177 binary => \0,
178 date => "2023-07-29T05:10:12",
179 deprecated => \0
180 ,
181 description => "Folklore::Japan is a totally fictious perl 5 module designed to serve as an example for the MetaCPAN API.",
182 directory => \0
183 ,
184 dist_fav_count => 1,
185 distribution => "Folklore::Japan",
186 documentation => "Folklore::Japan",
187 download_url => "https://cpan.metacpan.org/authors/id/M/MO/MOMOTARO/Folklore-Japan-v1.2.3.tar.gz",
188 id => "l0tsOf1192fuN100",
189 indexed => \1
190 ,
191 level => 1,
192 maturity => "released",
193 mime => "text/x-script.perl-module",
194 module => [
195 {
196 associated_pod => "MOMOTARO/Folklore-Japan-v1.2.3/lib/Folklore/Japan.pm",
197 authorized => \1
198 ,
199 indexed => \1
200 ,
201 name => "Folklore::Japan",
202 version => "v1.2.3",
203 version_numified => "1.002003",
204 },
205 ],
206 name => "Japan.pm",
207 path => "lib/Folklore/Japan.pm",
208 pod => "NAME Folklore::Japan - Japan Folklore Object Class VERSION version v1.2.3 SYNOPSIS use Folklore::Japan; my \$fun = Folklore::Japan->new; DESCRIPTION This is an imaginary class object to Japan folklore to only serve as dummy example AUTHOR Momo Taro <momo.taro\@example.jp> COPYRIGHT AND LICENSE This software is copyright (c) 2023 by Okayama, Inc.. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.",
209 pod_lines => [
210 [
211 1192,
212 1868,
213 ],
214 ],
215 release => "Folklore-Japan-v1.2.3",
216 sloc => 202,
217 slop => 637,
218 stat => {
219 gid => 12345,
220 mode => 33188,
221 mtime => 1690618397,
222 size => 10240,
223 uid => 16790,
224 },
225 status => "latest",
226 suggest => {
227 input => [
228 "Folklore::Japan",
229 ],
230 payload => {
231 doc_name => "Folklore::Japan",
232 },
233 weight => 985,
234 },
235 version => "v1.2.3",
236 version_numified => "1.002003",
237 } ) || die( Net::API::CPAN::File->error );
238
239 my $string = $obj->abstract;
240 # Returns a scalar object when this is a string, or an Net::API::CPAN::Author object
241 my $author = $obj->author;
242 my $bool = $obj->authorized;
243 my $bool = $obj->binary;
244 my $string = $obj->category;
245 my $date = $obj->date;
246 my $bool = $obj->deprecated;
247 my $string = $obj->description;
248 my $string = $obj->dir;
249 my $bool = $obj->directory;
250 my $num = $obj->dist_fav_count;
251 my $string = $obj->distribution;
252 my $string = $obj->documentation;
253 my $uri = $obj->download_url;
254 my $string = $obj->id;
255 my $bool = $obj->indexed;
256 my $num = $obj->level;
257 my $string = $obj->maturity;
258 my $string = $obj->mime;
259 my $array = $obj->module;
260 foreach my $this ( @$array )
261 {
262 my $scalar = $this->associated_pod;
263 my $boolean = $this->authorized;
264 my $boolean = $this->indexed;
265 my $scalar = $this->name;
266 my $scalar = $this->version;
267 my $number = $this->version_numified;
268 }
269 my $string = $obj->name;
270 my $str = $obj->object;
271 my $string = $obj->path;
272 my $string = $obj->pod;
273 my $array = $obj->pod_lines;
274 # Returns a scalar object when this is a string, or an Net::API::CPAN::Release object
275 my $release = $obj->release;
276 my $num = $obj->sloc;
277 my $num = $obj->slop;
278 my $this = $obj->stat;
279 my $integer = $obj->stat->gid;
280 my $integer = $obj->stat->mode;
281 my $datetime = $obj->stat->mtime;
282 my $integer = $obj->stat->size;
283 my $integer = $obj->stat->uid;
284 my $string = $obj->status;
285 my $this = $obj->suggest;
286 my $array = $obj->suggest->input;
287 my $hash = $obj->suggest->payload;
288 my $integer = $obj->suggest->weight;
289 my $vers = $obj->version;
290 my $num = $obj->version_numified;
291  
292 =head1 VERSION
293  
294 v0.1.0
295  
296 =head1 DESCRIPTION
297  
298 This class serves to retrieve and manipulate files.
299  
300 It inherits from L<Net::API::CPAN::Generic>
301  
302 =head1 CONSTRUCTOR
303  
304 =head2 new
305  
306 Provided with an hash or hash reference of parameters, and this instantiates a new C<Net::API::CPAN::File> object.
307  
308 The parameters that can be provided bear the same name and supports the same values as the methods below.
309  
310 =head1 METHODS
311  
312 =head2 abstract
313  
314 $obj->abstract( "Japan Folklore Object Class" );
315 my $string = $obj->abstract;
316  
317 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
318  
319 =head2 author
320  
321 $obj->author( "MOMOTARO" );
322 # Returns a scalar object when this is a string, or an Net::API::CPAN::Author object
323 my $author = $obj->author;
324  
325 Sets or gets either a string or an L<Net::API::CPAN::Author> object, and returns either a L<scalar object|Module::Generic::Array> or an L<Net::API::CPAN::Author object|Net::API::CPAN::Author>, or C<undef> if nothing was set.
326  
327 =head2 authorized
328  
329 $obj->authorized(1);
330 my $bool = $obj->authorized;
331  
332 Sets or gets a boolean value, and returns a L<boolean object|Module::Generic::Boolean> or C<undef> if no value is set.
333  
334 =head2 binary
335  
336 $obj->binary(1);
337 my $bool = $obj->binary;
338  
339 Sets or gets a boolean value, and returns a L<boolean object|Module::Generic::Boolean> or C<undef> if no value is set.
340  
341 =head2 category
342  
343 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
344  
345 =head2 date
346  
347 $obj->date( "2023-07-29T05:10:12" );
348 my $datetime_obj = $obj->date;
349  
350 Sets or gets a datetime value, and returns a L<DateTime object|DateTime> that stringifies to the format that was provided with the string set (usally an ISO 8601 datetime format) or C<undef> if no value is set.
351  
352 =head2 deprecated
353  
354 $obj->deprecated(1);
355 my $bool = $obj->deprecated;
356  
357 Sets or gets a boolean value, and returns a L<boolean object|Module::Generic::Boolean> or C<undef> if no value is set.
358  
359 =head2 description
360  
361 $obj->description( "Folklore::Japan is a totally fictious perl 5 module designed to serve as an example for the MetaCPAN API." );
362 my $string = $obj->description;
363  
364 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
365  
366 =head2 dir
367  
368 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
369  
370 =head2 directory
371  
372 $obj->directory(1);
373 my $bool = $obj->directory;
374  
375 Sets or gets a boolean value, and returns a L<boolean object|Module::Generic::Boolean> or C<undef> if no value is set.
376  
377 =head2 dist_fav_count
378  
379 $obj->dist_fav_count(1);
380 my $number = $obj->dist_fav_count;
381  
382 Sets or gets an integer value, and returns a L<number object|Module::Generic::Number> or C<undef> if no value is set.
383  
384 =head2 distribution
385  
386 $obj->distribution( "Folklore::Japan" );
387 my $string = $obj->distribution;
388  
389 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
390  
391 =head2 documentation
392  
393 $obj->documentation( "Folklore::Japan" );
394 my $string = $obj->documentation;
395  
396 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
397  
398 =head2 download_url
399  
400 $obj->download_url( "https://cpan.metacpan.org/authors/id/M/MO/MOMOTARO/Folklore-Japan-v1.2.3.tar.gz" );
401 my $uri = $obj->download_url;
402  
403 Sets or gets an L<URI>, and returns an L<URI object|URI> or C<undef> if no value is set.
404  
405 =head2 id
406  
407 $obj->id( "l0tsOf1192fuN100" );
408 my $string = $obj->id;
409  
410 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
411  
412 =head2 indexed
413  
414 $obj->indexed(1);
415 my $bool = $obj->indexed;
416  
417 Sets or gets a boolean value, and returns a L<boolean object|Module::Generic::Boolean> or C<undef> if no value is set.
418  
419 =head2 level
420  
421 $obj->level(1);
422 my $number = $obj->level;
423  
424 Sets or gets an integer value, and returns a L<number object|Module::Generic::Number> or C<undef> if no value is set.
425  
426 =head2 maturity
427  
428 $obj->maturity( "released" );
429 my $string = $obj->maturity;
430  
431 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
432  
433 =head2 mime
434  
435 $obj->mime( "text/x-script.perl-module" );
436 my $string = $obj->mime;
437  
438 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
439  
440 =head2 module
441  
442 $obj->module( [
443 {
444 associated_pod => "MOMOTARO/Folklore-Japan-v1.2.3/lib/Folklore/Japan.pm",
445 authorized => \1,
446 indexed => $VAR1->[0]{authorized},
447 name => "Folklore::Japan",
448 version => "v1.2.3",
449 version_numified => "1.002003",
450 },
451 ] );
452 my $array = $obj->module;
453 foreach my $this ( @$array )
454 {
455 $this->associated_pod( "MOMOTARO/Folklore-Japan-v1.2.3/lib/Folklore/Japan.pm" );
456 my $scalar = $this->associated_pod;
457 $this->authorized( \1 );
458 my $boolean = $this->authorized;
459 $this->indexed( \1 );
460 my $boolean = $this->indexed;
461 $this->name( "Folklore::Japan" );
462 my $scalar = $this->name;
463 $this->version( "v1.2.3" );
464 my $scalar = $this->version;
465 $this->version_numified( 1.002003 );
466 my $number = $this->version_numified;
467 }
468  
469 Sets or gets an array of dynamic class objects with class name C<Net::API::CPAN::File::Module> and having the folowing properties also accessible as methods, and returns an L<array object|Module::Generic::Array> even if there is no value.
470  
471 A C<Net::API::CPAN::File::Module> object will be instantiated with each value from the array provided and replace said value.
472  
473 =over 4
474  
475 =item * C<associated_pod> scalar_as_object
476  
477 =item * C<authorized> boolean (L<boolean object|Module::Generic::Boolean>)
478  
479 =item * C<indexed> boolean (L<boolean object|Module::Generic::Boolean>)
480  
481 =item * C<name> scalar_as_object
482  
483 =item * C<version> scalar_as_object
484  
485 =item * C<version_numified> number
486  
487 =back
488  
489 =head2 name
490  
491 $obj->name( "Japan.pm" );
492 my $string = $obj->name;
493  
494 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
495  
496 =head2 object
497  
498 Returns the object type for this class, which is C<file>
499  
500 =head2 path
501  
502 $obj->path( "lib/Folklore/Japan.pm" );
503 my $string = $obj->path;
504  
505 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
506  
507 =head2 pod
508  
509 $obj->pod( "NAME Folklore::Japan - Japan Folklore Object Class VERSION version v1.2.3 SYNOPSIS use Folklore::Japan; my \$fun = Folklore::Japan->new; DESCRIPTION This is an imaginary class object to Japan folklore to only serve as dummy example AUTHOR Momo Taro <momo.taro\@example.jp> COPYRIGHT AND LICENSE This software is copyright (c) 2023 by Okayama, Inc.. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself." );
510 my $string = $obj->pod;
511  
512 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
513  
514 =head2 pod_lines
515  
516 $obj->pod_lines( [
517 [
518 1192,
519 1868,
520 ],
521 ] );
522 my $array = $obj->pod_lines;
523  
524 Sets or gets an array of pod_lines and returns an L<array object|Module::Generic::Array>, even if there is no value.
525  
526 =head2 release
527  
528 $obj->release( "Folklore-Japan-v1.2.3" );
529 # Returns a scalar object when this is a string, or an Net::API::CPAN::Release object
530 my $release = $obj->release;
531  
532 Sets or gets either a string or an L<Net::API::CPAN::Release> object, and returns either a L<scalar object|Module::Generic::Array> or an L<Net::API::CPAN::Release object|Net::API::CPAN::Release>, or C<undef> if nothing was set.
533  
534 =head2 sloc
535  
536 $obj->sloc(202);
537 my $number = $obj->sloc;
538  
539 Sets or gets an integer value, and returns a L<number object|Module::Generic::Number> or C<undef> if no value is set.
540  
541 =head2 slop
542  
543 $obj->slop(637);
544 my $number = $obj->slop;
545  
546 Sets or gets an integer value, and returns a L<number object|Module::Generic::Number> or C<undef> if no value is set.
547  
548 =head2 stat
549  
550 $obj->stat( {
551 gid => 12345,
552 mode => 33188,
553 mtime => 1690618397,
554 size => 10240,
555 uid => 16790,
556 } );
557 my $this = $obj->stat;
558 $obj->stat->gid( 12345 );
559 my $integer = $obj->stat->gid;
560 $obj->stat->mode( 33188 );
561 my $integer = $obj->stat->mode;
562 $obj->stat->mtime( 1690618397 );
563 my $datetime = $obj->stat->mtime;
564 $obj->stat->size( 10240 );
565 my $integer = $obj->stat->size;
566 $obj->stat->uid( 16790 );
567 my $integer = $obj->stat->uid;
568  
569 Sets or gets a dynamic class object with class name C<Net::API::CPAN::File::Stat> and having the folowing properties also accessible as methods, and returns an object from such class, or C<undef> if no value was provided.
570  
571 =over 4
572  
573 =item * C<gid> integer (L<number object|Module::Generic::Number>)
574  
575 =item * C<mode> integer (L<number object|Module::Generic::Number>)
576  
577 =item * C<mtime> datetime
578  
579 =item * C<size> integer (L<number object|Module::Generic::Number>)
580  
581 =item * C<uid> integer (L<number object|Module::Generic::Number>)
582  
583 =back
584  
585 =head2 status
586  
587 $obj->status( "latest" );
588 my $string = $obj->status;
589  
590 Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
591  
592 =head2 suggest
593  
594 $obj->suggest( {
595 input => [
596 "Folklore::Japan",
597 ],
598 payload => {
599 doc_name => "Folklore::Japan",
600 },
601 weight => 985,
602 } );
603 my $this = $obj->suggest;
604 $obj->suggest->input( [
605 "Folklore::Japan",
606 ] );
607 my $array = $obj->suggest->input;
608 $obj->suggest->payload( {
609 doc_name => "Folklore::Japan",
610 } );
611 my $hash = $obj->suggest->payload;
612 $obj->suggest->weight( 985 );
613 my $integer = $obj->suggest->weight;
614  
615 Sets or gets a dynamic class object with class name C<Net::API::CPAN::File::Suggest> and having the folowing properties also accessible as methods, and returns an object from such class, or C<undef> if no value was provided.
616  
617 =over 4
618  
619 =item * C<input> array (L<array object|Module::Generic::Array>)
620  
621 =item * C<payload> hash_as_object
622  
623 =item * C<weight> integer (L<number object|Module::Generic::Number>)
624  
625 =back
626  
627 =head2 version
628  
629 $obj->version( "v1.2.3" );
630 my $version = $obj->version;
631  
632 Sets or gets a version value and returns a version object using L<Changes::Version>.
633  
634 =head2 version_numified
635  
636 $obj->version_numified("1.002003");
637 my $number = $obj->version_numified;
638  
639 Sets or gets a float value, and returns a L<number object|Module::Generic::Number> or C<undef> if no value is set.
640  
641 =head1 API SAMPLE
642  
643 {
644 "abstract" : "Japan Folklore Object Class",
645 "author" : "MOMOTARO",
646 "authorized" : true,
647 "binary" : false,
648 "date" : "2023-07-29T05:10:12",
649 "deprecated" : false,
650 "description" : "Folklore::Japan is a totally fictious perl 5 module designed to serve as an example for the MetaCPAN API.",
651 "directory" : false,
652 "dist_fav_count" : 1,
653 "distribution" : "Folklore::Japan",
654 "documentation" : "Folklore::Japan",
655 "download_url" : "https://cpan.metacpan.org/authors/id/M/MO/MOMOTARO/Folklore-Japan-v1.2.3.tar.gz",
656 "id" : "l0tsOf1192fuN100",
657 "indexed" : true,
658 "level" : 1,
659 "maturity" : "released",
660 "mime" : "text/x-script.perl-module",
661 "module" : [
662 {
663 "associated_pod" : "MOMOTARO/Folklore-Japan-v1.2.3/lib/Folklore/Japan.pm",
664 "authorized" : true,
665 "indexed" : true,
666 "name" : "Folklore::Japan",
667 "version" : "v1.2.3",
668 "version_numified" : 1.002003
669 }
670 ],
671 "name" : "Japan.pm",
672 "path" : "lib/Folklore/Japan.pm",
673 "pod" : "NAME Folklore::Japan - Japan Folklore Object Class VERSION version v1.2.3 SYNOPSIS use Folklore::Japan; my $fun = Folklore::Japan->new; DESCRIPTION This is an imaginary class object to Japan folklore to only serve as dummy example AUTHOR Momo Taro <momo.taro@example.jp> COPYRIGHT AND LICENSE This software is copyright (c) 2023 by Okayama, Inc.. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.",
674 "pod_lines" : [
675 [
676 1192,
677 1868
678 ]
679 ],
680 "release" : "Folklore-Japan-v1.2.3",
681 "sloc" : 202,
682 "slop" : 637,
683 "stat" : {
684 "gid" : 12345,
685 "mode" : 33188,
686 "mtime" : 1690618397,
687 "size" : 10240,
688 "uid" : 16790
689 },
690 "status" : "latest",
691 "suggest" : {
692 "weight" : 985,
693 "payload" : {
694 "doc_name" : "Folklore::Japan"
695 },
696 "input" : [
697 "Folklore::Japan"
698 ]
699 },
700 "version" : "v1.2.3",
701 "version_numified" : 1.002003
702 }
703  
704 =head1 AUTHOR
705  
706 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
707  
708 =head1 SEE ALSO
709  
710 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>
711  
712 L<MetaCPAN::API>, L<MetaCPAN::Client>
713  
714 L<https://github.com/metacpan/metacpan-api/blob/master/docs/API-docs.md>
715  
716 =head1 COPYRIGHT & LICENSE
717  
718 Copyright(c) 2023 DEGUEST Pte. Ltd.
719  
720 All rights reserved
721  
722 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
723  
724 =cut
725  
« lib/Net/API/CPAN/Author.pm ↑ Summary blib/lib/Net/API/CPAN/Cover.pm »