File Coverage

blib/lib/SBOM/CycloneDX/Declarations/Contents.pm
Criterion Covered Total %
statement 23 28 82.1
branch 0 4 0.0
condition n/a
subroutine 8 9 88.8
pod 1 1 100.0
total 32 42 76.1


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