| 1 | package Games::Sudoku::Component::Result; | ||||||||||||||||||||
| 2 | { | ||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 2 | ▶ | use Carp; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 2 | our $VERSION = '0.01'; | |||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | use overload | ||||||||||||||||||||
| 10 | 2 | ▶ | '0+' => \&result, | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | '""' => \&result, | ||||||||||||||||||||
| 12 | 3 | ▶ | '<=>' => sub { $_[0]->result <=> $_[1] }, | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | 2 | ▶ | 'cmp' => sub { $_[0]->result cmp $_[1] }; | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=8 SCAR=24.7
Pod
documented
| |||||||||||||||||||||
| 16 | 3 | my $class = shift; | |||||||||||||||||||
| 17 | 3 | ▶ | my $this = bless {}, (ref $class || $class); | ||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 3 | ▶ | if (@_ == 1) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 20 | 1 | ▶ | if (ref $_[0] eq 'HASH') { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 21 | 0 | my %options = %{ $_[0] }; | |||||||||||||||||||
| 22 | 0 | ▶ | $this->{result} = $options{result} || 0; | ||||||||||||||||||
|
Condition0%0/2
$options{'result'} || 0
MC/DC0%0/1
$options{'result'} || 0
$options{'result'}
Truth table0%0/2
A
A= $options{'result'}
| |||||||||||||||||||||
| 23 | 0 | ▶ | $this->{reason} = $options{reason} || ''; | ||||||||||||||||||
|
Condition0%0/2
$options{'reason'} || ''
MC/DC0%0/1
$options{'reason'} || ''
$options{'reason'}
Truth table0%0/2
A
A= $options{'reason'}
| |||||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | else { | ||||||||||||||||||||
| 26 | 1 | $this->{result} = $_[0]; | |||||||||||||||||||
| 27 | } | ||||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | else { | ||||||||||||||||||||
| 30 | 2 | my %options = @_; | |||||||||||||||||||
| 31 | 2 | ▶ | $this->{result} = $options{result} || 0; | ||||||||||||||||||
|
Condition100%2/2
$options{'result'} || 0
MC/DC100%1/1
$options{'result'} || 0
$options{'result'}
Truth table100%2/2
A
A= $options{'result'}
| |||||||||||||||||||||
| 32 | 2 | ▶ | $this->{reason} = $options{reason} || ''; | ||||||||||||||||||
|
Condition100%2/2
$options{'reason'} || ''
MC/DC100%1/1
$options{'reason'} || ''
$options{'reason'}
Truth table100%2/2
A
A= $options{'reason'}
| |||||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 3 | $this; | |||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 11 | ▶ | sub result { $_[0]->{result} } | ||||||||||||||||||
|
Subroutine
result: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 39 | 2 | ▶ | sub reason { $_[0]->{reason} } | ||||||||||||||||||
|
Subroutine
reason: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 2 | 1; | |||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||||