line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::Mitey::Cards::Card::Numeric; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.016'; |
4
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
1067
|
use Acme::Mitey::Cards::Mite qw( -all ); |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
48
|
|
7
|
4
|
|
|
4
|
|
27
|
use Acme::Mitey::Cards::Types qw( :types ); |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
1486
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
extends 'Acme::Mitey::Cards::Card'; |
10
|
|
|
|
|
|
|
|
11
|
4
|
|
|
4
|
|
562
|
use Acme::Mitey::Cards::Suit; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
672
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has suit => ( |
14
|
|
|
|
|
|
|
is => ro, |
15
|
|
|
|
|
|
|
isa => Suit, |
16
|
|
|
|
|
|
|
required => true, |
17
|
|
|
|
|
|
|
coerce => true, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has number => ( |
21
|
|
|
|
|
|
|
is => ro, |
22
|
|
|
|
|
|
|
isa => CardNumber, |
23
|
|
|
|
|
|
|
required => true, |
24
|
|
|
|
|
|
|
coerce => true, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
signature_for number_or_a => ( |
28
|
|
|
|
|
|
|
pos => [], |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub number_or_a { |
32
|
|
|
|
|
|
|
my $self = shift; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $num = $self->number; |
35
|
|
|
|
|
|
|
( $num == 1 ) ? 'A' : $num; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
signature_for '+to_string'; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub to_string { |
41
|
|
|
|
|
|
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
return sprintf( '%s%s', $self->number_or_a, $self->suit->abbreviation ); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |