| 1 | package CSAF::Type::Note; | ||||||||||
| 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 @CATEGORIES = ('description', 'details', 'faq', 'general', 'legal_disclaimer', 'other', 'summary'); | |||||||||
| 12 | |||||||||||
| 13 | has category => ( | ||||||||||
| 14 | is => 'rw', | ||||||||||
| 15 | required => 1, | ||||||||||
| 16 | 0 | ▶ | isa => sub { Carp::croak 'Unknown note "category"' unless grep(/$_[0]/, @CATEGORIES) } | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||
| 17 | 1 | ); | |||||||||
| 18 | |||||||||||
| 19 | 1 | has text => (is => 'rw', required => 1); | |||||||||
| 20 | 1 | has audience => (is => 'rw'); | |||||||||
| 21 | 1 | has title => (is => 'rw'); | |||||||||
| 22 | |||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | sub TO_CSAF { | ||||||||
|
Subroutine
TO_CSAF: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 25 | |||||||||||
| 26 | 0 | my $self = shift; | |||||||||
| 27 | |||||||||||
| 28 | 0 | my $output = {category => $self->category, text => $self->text}; | |||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | $output->{audience} = $self->audience if ($self->audience); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | 0 | ▶ | $output->{title} = $self->title if ($self->title); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | |||||||||||
| 33 | 0 | return $output; | |||||||||
| 34 | |||||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 1 | 1; | |||||||||
| 38 | |||||||||||
| 39 | __END__ | ||||||||||