File Coverage

blib/lib/WWW/ArsenalFC/TicketInformation/Category.pm
Criterion Covered Total %
statement 19 19 100.0
branch 3 4 75.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 28 29 96.5


line stmt bran cond sub pod time code
1 3     3   26851 use strict;
  3         7  
  3         148  
2 3     3   17 use warnings;
  3         5  
  3         407  
3              
4             package WWW::ArsenalFC::TicketInformation::Category;
5             {
6             $WWW::ArsenalFC::TicketInformation::Category::VERSION = '1.123160';
7             }
8              
9 3     3   741 use WWW::ArsenalFC::TicketInformation::Util ':all';
  3         7  
  3         904  
10              
11             # ABSTRACT: Represents categories for upcoming Premier League fixtures.
12              
13 3         22 use Object::Tiny qw{
14             category
15             date_string
16             opposition
17 3     3   1369 };
  3         379  
18              
19             sub date {
20 12     12 1 2530 my ($self) = @_;
21              
22 12 50       293 if ( $self->date_string =~ /\w+\W+(\w+)\D(\d+)/ ) {
23 12         120 my $year = '2012'; # FIXME
24 12         55 my $month = month_to_number($1);
25 12         30 my $day = $2;
26 12 100       47 $day = "0$day" if $day =~ /^\d$/;
27 12         97 return "$year-$month-$day";
28             }
29             }
30              
31             1;
32              
33              
34              
35             =pod
36              
37             =head1 NAME
38              
39             WWW::ArsenalFC::TicketInformation::Category - Represents categories for upcoming Premier League fixtures.
40              
41             =head1 VERSION
42              
43             version 1.123160
44              
45             =head1 ATTRIBUTES
46              
47             =head2 category
48              
49             The category of the match (A, B or C).
50              
51             =head2 date_string
52              
53             The date as it appears on the website.
54              
55             =head2 opposition
56              
57             The opposition.
58              
59             =head1 METHODS
60              
61             =head2 date
62              
63             The date as YYYY-MM-DD.
64              
65             =head1 AUTHOR
66              
67             Andrew Jones
68              
69             =head1 COPYRIGHT AND LICENSE
70              
71             This software is copyright (c) 2012 by Andrew Jones.
72              
73             This is free software; you can redistribute it and/or modify it under
74             the same terms as the Perl 5 programming language system itself.
75              
76             =cut
77              
78              
79             __END__