File Coverage

blib/lib/SBOM/CycloneDX/Component/Graphic.pm
Criterion Covered Total %
statement 20 25 80.0
branch 0 4 0.0
condition n/a
subroutine 7 8 87.5
pod 1 1 100.0
total 28 38 73.6


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