| 1 | package Games::Dukedom::Signal; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | our $VERSION = 'v0.1.2'; | |||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 4 | with 'Throwable'; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | use overload | ||||||||||||||||||||||||||||
| 9 | 4 | ▶ | q{""} => 'as_string', | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 4 | fallback => 1; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | around BUILDARGS => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 13 | 2 | my $orig = shift; | |||||||||||||||||||||||||||
| 14 | 2 | my $class = shift; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 2 | ▶ | unshift( @_, 'msg' ) if @_ == 1 && !ref( $_[0] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@_ == 1 and not ref $_[0]
MC/DC50%1/2
@_ == 1 and not ref $_[0]
@_ == 1
not ref $_[0]
Truth table66%2/3
A and not(B)
A= @_ == 1B= not ref $_[0]
| |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 2 | return $class->$orig( {@_} ); | |||||||||||||||||||||||||||
| 19 | 4 | }; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 4 | has msg => ( | |||||||||||||||||||||||||||
| 22 | is => 'ro', | ||||||||||||||||||||||||||||
| 23 | default => undef, | ||||||||||||||||||||||||||||
| 24 | ); | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 4 | has action => ( | |||||||||||||||||||||||||||
| 27 | is => 'ro', | ||||||||||||||||||||||||||||
| 28 | default => undef, | ||||||||||||||||||||||||||||
| 29 | ); | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 4 | has default => ( | |||||||||||||||||||||||||||
| 32 | is => 'ro', | ||||||||||||||||||||||||||||
| 33 | default => undef, | ||||||||||||||||||||||||||||
| 34 | ); | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | ▶ | sub as_string { | ||||||||||||||||||||||||||
|
Subroutine
as_string: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 37 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 0 | my $str = ref($self); | |||||||||||||||||||||||||||
| 40 | 0 | for ( keys(%{$self}) ) { | |||||||||||||||||||||||||||
| 41 | 0 | ▶ | $str .= "\n $_: " . ($self->{$_} || ''); | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{$_} || ''
MC/DC0%0/1
$self->{$_} || ''
$self->{$_}
Truth table0%0/2
A
A= $self->{$_}
| |||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 0 | return $str; | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 4 | 1; | |||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | __END__ | ||||||||||||||||||||||||||||