| 1 | package CSAF::Type::TLP; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | extends 'CSAF::Type::Base'; | |||||||||
| 10 | |||||||||||
| 11 | 1 | my @LABELS = (qw[AMBER GREEN RED WHITE]); | |||||||||
| 12 | |||||||||||
| 13 | has label => ( | ||||||||||
| 14 | is => 'rw', | ||||||||||
| 15 | default => 'WHITE', | ||||||||||
| 16 | 2 | ▶ | isa => sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.1
| |||||||||||
| 17 | 2 | my $test = shift; | |||||||||
| 18 | 2 | ▶ | Carp::croak 'Unknown TLP label' unless grep { $test eq $_ } @LABELS; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | }, | ||||||||||
| 20 | 2 | ▶ | coerce => sub { uc $_[0] } | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 1 | ); | |||||||||
| 22 | |||||||||||
| 23 | 1 | has url => (is => 'rw', default => 'https://www.first.org/tlp/'); | |||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub TO_CSAF { | ||||||||
|
Subroutine
TO_CSAF: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 26 | |||||||||||
| 27 | 0 | my $self = shift; | |||||||||
| 28 | |||||||||||
| 29 | 0 | my $output = {}; | |||||||||
| 30 | |||||||||||
| 31 | 0 | $output->{label} = $self->label; | |||||||||
| 32 | 0 | ▶ | $output->{url} = $self->url if ($self->url); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | |||||||||||
| 34 | 0 | return $output; | |||||||||
| 35 | |||||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 1 | 1; | |||||||||
| 39 | |||||||||||
| 40 | __END__ | ||||||||||