File Coverage

blib/lib/SBOM/CycloneDX/BomRef.pm
Criterion Covered Total %
statement 25 25 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod 2 2 100.0
total 37 37 100.0


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::BomRef;
2              
3 16     16   218 use 5.010001;
  16         44  
4 16     16   72 use strict;
  16         23  
  16         318  
5 16     16   106 use warnings;
  16         42  
  16         652  
6 16     16   94 use utf8;
  16         47  
  16         76  
7              
8 16     16   513 use Carp;
  16         48  
  16         950  
9 16     16   5884 use Time::Piece;
  16         126913  
  16         117  
10              
11 16     16   1353 use overload '""' => \&to_string, fallback => 1;
  16         26  
  16         86  
12              
13 16     16   7215 use Moo;
  16         82037  
  16         68  
14              
15             around BUILDARGS => sub {
16              
17             my ($orig, $class, @args) = @_;
18              
19             return {value => $args[0]} if @args == 1;
20             return $class->$orig(@args);
21              
22             };
23              
24             has value => (is => 'rw', required => 1);
25              
26 132     132 1 513 sub to_string { shift->TO_JSON }
27              
28 246     246 1 1775 sub TO_JSON { shift->value }
29              
30             1;
31              
32             =encoding utf-8
33              
34             =head1 NAME
35              
36             SBOM::CycloneDX::BomRef - BOM-ref representation for CycloneDX
37              
38             =head1 SYNOPSIS
39              
40             $component->bom_ref(SBOM::CycloneDX::BomRef->new('app-component'));
41              
42              
43             =head1 DESCRIPTION
44              
45             L represents the BOM reference in L.
46              
47             =head2 METHODS
48              
49             =over
50              
51             =item SBOM::CycloneDX::BomRef->new( %PARAMS )
52              
53             =item $bom_ref->value
54              
55             =item $bom_ref->to_string
56              
57             =item $bom_ref->TO_JSON
58              
59             Return BOM ref.
60              
61             =back
62              
63             =head1 SUPPORT
64              
65             =head2 Bugs / Feature Requests
66              
67             Please report any bugs or feature requests through the issue tracker
68             at L.
69             You will be notified automatically of any progress on your issue.
70              
71             =head2 Source Code
72              
73             This is open source software. The code repository is available for
74             public review and contribution under the terms of the license.
75              
76             L
77              
78             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
79              
80              
81             =head1 AUTHOR
82              
83             =over 4
84              
85             =item * Giuseppe Di Terlizzi
86              
87             =back
88              
89              
90             =head1 LICENSE AND COPYRIGHT
91              
92             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
93              
94             This is free software; you can redistribute it and/or modify it under
95             the same terms as the Perl 5 programming language system itself.
96              
97             =cut