File Coverage

lib/Net/API/CPAN/Cve.pm
Criterion Covered Total %
statement 46 47 97.8
branch 11 22 50.0
condition n/a
subroutine 18 19 94.7
pod 12 12 100.0
total 87 100 87.0


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## Meta CPAN API - ~/lib/Net/API/CPAN/Cve.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::Cve;
17             BEGIN
18             {
19 2     2   233308 use strict;
  2         12  
  2         54  
20 2     2   8 use warnings;
  2         3  
  2         50  
21 2     2   7 use parent qw( Net::API::CPAN::Generic );
  2         3  
  2         12  
22 2     2   100 use vars qw( $VERSION );
  2         12  
  2         78  
23 2     2   36 our $VERSION = 'v0.1.0';
24             };
25              
26 2     2   8 use strict;
  2         2  
  2         35  
27 2     2   8 use warnings;
  2         3  
  2         728  
28              
29             sub init
30             {
31 1     1 1 9176 my $self = shift( @_ );
32 1 50       66 $self->{affected_versions} = undef unless( CORE::exists( $self->{affected_versions} ) );
33 1 50       5 $self->{cpansa_id} = undef unless( CORE::exists( $self->{cpansa_id} ) );
34 1 50       4 $self->{cves} = undef unless( CORE::exists( $self->{cves} ) );
35 1 50       3 $self->{description} = undef unless( CORE::exists( $self->{description} ) );
36 1 50       4 $self->{distribution} = undef unless( CORE::exists( $self->{distribution} ) );
37 1         2 $self->{object} = 'cve';
38 1 50       3 $self->{references} = undef unless( CORE::exists( $self->{references} ) );
39 1 50       5 $self->{releases} = undef unless( CORE::exists( $self->{releases} ) );
40 1 50       4 $self->{reported} = undef unless( CORE::exists( $self->{reported} ) );
41 1 50       4 $self->{severity} = undef unless( CORE::exists( $self->{severity} ) );
42 1 50       3 $self->{versions} = undef unless( CORE::exists( $self->{versions} ) );
43 1         2 $self->{_init_strict_use_sub} = 1;
44 1         2 $self->{_exception_class} = 'Net::API::CPAN::Exception';
45 1 50       7 $self->SUPER::init( @_ ) || return( $self->pass_error );
46 1         6 $self->{fields} = [qw(
47             affected_versions cpansa_id cves description distribution references releases
48             reported severity versions
49             )];
50 1         2 return( $self );
51             }
52              
53 1     1 1 4503 sub affected_versions { return( shift->_set_get_scalar_as_object( 'affected_versions', @_ ) ); }
54              
55 1     1 1 56747 sub cpansa_id { return( shift->_set_get_scalar_as_object( 'cpansa_id', @_ ) ); }
56              
57 1     1 1 1071 sub cves { return( shift->_set_get_scalar_as_object( 'cves', @_ ) ); }
58              
59 1     1 1 944 sub description { return( shift->_set_get_scalar_as_object( 'description', @_ ) ); }
60              
61 1     1 1 942 sub distribution { return( shift->_set_get_scalar_as_object( 'distribution', @_ ) ); }
62              
63 0     0 1 0 sub object { return( shift->_set_get_scalar_as_object( 'object', @_ ) ); }
64              
65 1     1 1 960 sub references { return( shift->_set_get_scalar_as_object( 'references', @_ ) ); }
66              
67 1     1 1 984 sub releases { return( shift->_set_get_scalar_as_object( 'releases', @_ ) ); }
68              
69 1     1 1 949 sub reported { return( shift->_set_get_datetime( 'reported', @_ ) ); }
70              
71 1     1 1 2547 sub severity { return( shift->_set_get_scalar_as_object( 'severity', @_ ) ); }
72              
73 1     1 1 952 sub versions { return( shift->_set_get_scalar_as_object( 'versions', @_ ) ); }
74              
75             1;
76             # NOTE: POD
77             __END__
78              
79             =encoding utf-8
80              
81             =head1 NAME
82              
83             Net::API::CPAN::Cve - Meta CPAN API Cve Class
84              
85             =head1 SYNOPSIS
86              
87             use Net::API::CPAN::Cve;
88             my $string = $obj->affected_versions;
89             my $string = $obj->cpansa_id;
90             my $string = $obj->cves;
91             my $string = $obj->description;
92             my $string = $obj->distribution;
93             my $str = $obj->object;
94             my $string = $obj->references;
95             my $string = $obj->releases;
96             my $date = $obj->reported;
97             my $string = $obj->severity;
98             my $string = $obj->versions;
99              
100             =head1 VERSION
101              
102             v0.1.0
103              
104             =head1 DESCRIPTION
105              
106             This class serves to retrieve and manipulate cves.
107              
108             It inherits from L<Net::API::CPAN::Generic>
109              
110             =head1 CONSTRUCTOR
111              
112             =head2 new
113              
114             Provided with an hash or hash reference of parameters, and this instantiates a new C<Net::API::CPAN::Cve> object.
115              
116             The parameters that can be provided bear the same name and supports the same values as the methods below.
117              
118             =head1 METHODS
119              
120             =head2 affected_versions
121              
122             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
123              
124             =head2 cpansa_id
125              
126             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
127              
128             =head2 cves
129              
130             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
131              
132             =head2 description
133              
134             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
135              
136             =head2 distribution
137              
138             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
139              
140             =head2 object
141              
142             Returns the object type for this class, which is C<cve>
143              
144             =head2 references
145              
146             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
147              
148             =head2 releases
149              
150             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
151              
152             =head2 reported
153              
154             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.
155              
156             =head2 severity
157              
158             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
159              
160             =head2 versions
161              
162             Sets or gets a string and returns a L<scalar object|Module::Generic::Scalar>, even if there is no value.
163              
164             =head1 AUTHOR
165              
166             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
167              
168             =head1 SEE ALSO
169              
170             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>
171              
172             L<MetaCPAN::API>, L<MetaCPAN::Client>
173              
174             L<https://github.com/metacpan/metacpan-api/blob/master/docs/API-docs.md>
175              
176             =head1 COPYRIGHT & LICENSE
177              
178             Copyright(c) 2023 DEGUEST Pte. Ltd.
179              
180             All rights reserved
181              
182             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
183              
184             =cut
185