| 1 | package WWW::Live::Auth::Offer; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 1 | ▶ | use WWW::Live::Auth::Utils; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 1 | ▶ | use Carp; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | sub new { | ||||||||||||||||||||
| 10 | 0 | ▶ | my ( $proto, %args ) = @_; | ||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 11 | 0 | ▶ | my $class = ref $proto || $proto; | ||||||||||||||||||
|
Condition0%0/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 12 | my $self = bless { | ||||||||||||||||||||
| 13 | 'offer' => $args{'offer'}, | ||||||||||||||||||||
| 14 | 'action' => $args{'action'}, | ||||||||||||||||||||
| 15 | 0 | 'expires' => $args{'expires'} | |||||||||||||||||||
| 16 | }, $class; | ||||||||||||||||||||
| 17 | 0 | $self->_process; | |||||||||||||||||||
| 18 | 0 | return $self; | |||||||||||||||||||
| 19 | } | ||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | sub offer { | ||||||||||||||||||||
| 22 | 0 | ▶ | my ( $self ) = @_; | ||||||||||||||||||
|
Subroutine
offer: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 23 | 0 | return $self->{'offer'}; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | sub action { | ||||||||||||||||||||
| 27 | 0 | ▶ | my ( $self ) = @_; | ||||||||||||||||||
|
Subroutine
action: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 28 | 0 | return $self->{'action'}; | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | sub expires { | ||||||||||||||||||||
| 32 | 0 | ▶ | my ( $self ) = @_; | ||||||||||||||||||
|
Subroutine
expires: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 33 | 0 | return $self->{'expires'}; | |||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | sub as_string { | ||||||||||||||||||||
| 37 | 0 | ▶ | my ( $self ) = @_; | ||||||||||||||||||
|
Subroutine
as_string: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 38 | 0 | return $self->offer . '.' . $self->action; | |||||||||||||||||||
| 39 | } | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | sub _process { | ||||||||||||||||||||
| 42 | 0 | ▶ | my ( $self ) = @_; | ||||||||||||||||||
|
Subroutine
_process: not called CC=4 SCAR=30.0
| |||||||||||||||||||||
| 43 | 0 | ▶ | if ( !$self->{'action'} ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 44 | 0 | my ($offer, $action, $expires) = split /[\.:]/, $self->{'offer'}; | |||||||||||||||||||
| 45 | 0 | ▶ | $self->{'offer'} = $offer || croak('Could not parse offer'); | ||||||||||||||||||
|
Condition0%0/3
$offer || croak('Could not parse offer')
MC/DC0%0/2
$offer || croak('Could not parse offer')
$offer
croak('Could not parse offer')
Truth table0%0/3
A || B
A= $offerB= croak('Could not parse offer')
| |||||||||||||||||||||
| 46 | 0 | ▶ | $self->{'action'} = $action || croak('Could not parse offer action'); | ||||||||||||||||||
|
Condition0%0/3
$action || croak('Could not parse offer action')
MC/DC0%0/2
$action || croak('Could not parse offer action')
$action
croak('Could not parse offer action')
Truth table0%0/3
A || B
A= $actionB= croak('Could not parse offer action')
| |||||||||||||||||||||
| 47 | 0 | $self->{'expires'}; # optional | |||||||||||||||||||
| 48 | } | ||||||||||||||||||||
| 49 | } | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 1 | 1; | |||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||