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