lib/VANAMBURG/Suit.pm

filter: Statementstmt 100% 12 / 12 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 2 / 2 Podpod 100% 1 / 1 totaltotal 87.5% 21 / 24 CC 4 SCAR 12.4
CC
4
Cov
89%
equals
4.1
BEGIN
1.0
CRAP 3.5
« lib/VANAMBURG/FaceValue.pm ↑ Summary lib/VANAMBURG/SiStebbins.pm »
1 package VANAMBURG::Suit;
2 7 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 =head1 VANAMBURG::Suit
5  
6 Represents the suit aspect of a card.
7  
8 =cut
9  
10 =head2 name
11  
12 The name of the card, such as "Jack", "Queen", "Two", etc.
13  
14 =cut
15  
16 7 has 'name' => ( isa => 'Str', is => 'ro', required => 1 );
17  
18 =head2 abbreviation
19  
20 A single character representation of the suit such as "H" for heard, etc.
21  
22 =cut
23  
24 7 has 'abbreviation' => ( isa => 'Str', is => 'ro', required => 1 );
25  
26 =head2 unicode_char
27  
28 A unicode represendation of the suit symbol.
29  
30 =cut
31  
32 7 has 'unicode_char' => ( isa => 'Str', is => 'ro', required => 1 );
33  
34 =head2 equals
35  
36 Returns true (1) if the name and abbreviation of this object are the
37 same as the suit passed as the parameter.
38  
39 =cut
40  
41 6 ▶sub equals {
Subroutine equals: called CC=4 SCAR=14.0
Pod documented
42 6 my ( $self, $other ) = @_;
43 6 ▶ return 0 if ( !defined $other );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $other 0 6 6
44 6 ▶ if ( $self->name eq $other->name && $self->abbreviation eq $other->abbreviation ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->name eq $other->name and $self->abbreviation eq $other->abbreviation) { } 5 1 6
Condition66%2/3
$self->name eq $other->name and $self->abbreviation eq $other->abbreviation
!ll&&!rl&&r
105
MC/DC50%1/2
$self->name eq $other->name and $self->abbreviation eq $other->abbreviation
$self->name eq $other->name $self->abbreviation eq $other->abbreviation
Truth table66%2/3
A and B
A= $self->name eq $other->nameB= $self->abbreviation eq $other->abbreviation
ABresult
0X0
100
111
45 5 return 1;
46 }
47 else {
48 1 return 0;
49 }
50 }
51  
52 7 1;
« lib/VANAMBURG/FaceValue.pm ↑ Summary lib/VANAMBURG/SiStebbins.pm »