| 1 | package WWW::Picnic::Result; | ||||||||||||||||||||||||||||
| 2 | 2 | our $VERSION = '0.100'; | |||||||||||||||||||||||||||
| 3 | 2 | our $AUTHORITY = 'cpan:GETTY'; | |||||||||||||||||||||||||||
| 4 | # ABSTRACT: Base class for Picnic API result objects | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 2 | has raw => ( | |||||||||||||||||||||||||||
| 10 | is => 'ro', | ||||||||||||||||||||||||||||
| 11 | required => 1, | ||||||||||||||||||||||||||||
| 12 | ); | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | sub BUILDARGS { | ||||||||||||||||||||||||||||
| 16 | 14 | ▶ | my ( $class, @args ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
BUILDARGS: called CC=6 SCAR=22.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 17 | 14 | ▶ | if ( @args == 1 && ref $args[0] ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
@args == 1 and ref $args[0]
MC/DC0%0/2
@args == 1 and ref $args[0]
@args == 1
ref $args[0]
Truth table33%1/3
A and B
A= @args == 1B= ref $args[0]
| |||||||||||||||||||||||||||||
| 18 | 14 | my $ref_type = ref $args[0]; | |||||||||||||||||||||||||||
| 19 | # Accept both HASH and ARRAY as raw data | ||||||||||||||||||||||||||||
| 20 | 14 | ▶ | if ( $ref_type eq 'ARRAY' ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | 0 | return { raw => $args[0] }; | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | 14 | ▶ | if ( $ref_type eq 'HASH' && !exists $args[0]->{raw} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$ref_type eq "HASH" and not exists $args[0]{"raw"}
MC/DC0%0/2
$ref_type eq "HASH" and not exists $args[0]{"raw"}
$ref_type eq "HASH"
not exists $args[0]{"raw"}
Truth table33%1/3
A and not(B)
A= $ref_type eq "HASH"B= not exists $args[0]{"raw"}
| |||||||||||||||||||||||||||||
| 24 | 14 | return { raw => $args[0] }; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | 0 | return $class->SUPER::BUILDARGS(@args); | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | sub _get { | ||||||||||||||||||||||||||||
| 31 | 36 | ▶ | my ( $self, $key ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
_get: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 32 | 36 | return $self->raw->{$key}; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 2 | 1; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | __END__ | ||||||||||||||||||||||||||||