File Coverage

blib/lib/SBOM/CycloneDX/Component/GraphicsCollection.pm
Criterion Covered Total %
statement 26 32 81.2
branch 0 4 0.0
condition n/a
subroutine 9 10 90.0
pod 1 1 100.0
total 36 47 76.6


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::Component::GraphicsCollection;
2              
3 1     1   960 use 5.010001;
  1         3  
4 1     1   5 use strict;
  1         2  
  1         16  
5 1     1   3 use warnings;
  1         2  
  1         50  
6 1     1   4 use utf8;
  1         2  
  1         5  
7              
8 1     1   27 use SBOM::CycloneDX::List;
  1         2  
  1         28  
9              
10 1     1   3 use Types::Standard qw(Str InstanceOf);
  1         2  
  1         10  
11 1     1   1157 use Types::TypeTiny qw(ArrayLike);
  1         2  
  1         5  
12              
13 1     1   419 use Moo;
  1         2  
  1         6  
14 1     1   310 use namespace::autoclean;
  1         1  
  1         8  
15              
16             extends 'SBOM::CycloneDX::Base';
17              
18             has description => (is => 'rw', isa => Str);
19              
20             has collection => (
21             is => 'rw',
22             isa => ArrayLike [InstanceOf ['SBOM::CycloneDX::Component::Graphic']],
23             default => sub { SBOM::CycloneDX::List->new }
24             );
25              
26              
27             sub TO_JSON {
28              
29 0     0 1   my $self = shift;
30              
31 0           my $json = {};
32              
33 0 0         $json->{description} = $self->description if $self->description;
34 0 0         $json->{collection} = $self->collection if @{$self->collection};
  0            
35              
36 0           return $json;
37              
38             }
39              
40             1;
41              
42             =encoding utf-8
43              
44             =head1 NAME
45              
46             SBOM::CycloneDX::Component::GraphicsCollection - Graphics Collection
47              
48             =head1 SYNOPSIS
49              
50             SBOM::CycloneDX::Component::GraphicsCollection->new();
51              
52              
53             =head1 DESCRIPTION
54              
55             L provides a collection of graphics
56             that represent various measurements.
57              
58             =head2 METHODS
59              
60             L inherits all methods from L
61             and implements the following new ones.
62              
63             =over
64              
65             =item SBOM::CycloneDX::Component::GraphicsCollection->new( %PARAMS )
66              
67             Properties:
68              
69             =over
70              
71             =item * C, A collection of graphics.
72              
73             =item * C, A description of this collection of graphics.
74              
75             =back
76              
77             =item $graphics_collection->collection
78              
79             =item $graphics_collection->description
80              
81             =back
82              
83              
84             =head1 SUPPORT
85              
86             =head2 Bugs / Feature Requests
87              
88             Please report any bugs or feature requests through the issue tracker
89             at L.
90             You will be notified automatically of any progress on your issue.
91              
92             =head2 Source Code
93              
94             This is open source software. The code repository is available for
95             public review and contribution under the terms of the license.
96              
97             L
98              
99             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
100              
101              
102             =head1 AUTHOR
103              
104             =over 4
105              
106             =item * Giuseppe Di Terlizzi
107              
108             =back
109              
110              
111             =head1 LICENSE AND COPYRIGHT
112              
113             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
114              
115             This is free software; you can redistribute it and/or modify it under
116             the same terms as the Perl 5 programming language system itself.
117              
118             =cut