File Coverage

blib/lib/PRANG/Cookbook/Role/Time.pm
Criterion Covered Total %
statement 4 6 66.6
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 6 8 75.0


line stmt bran cond sub pod time code
1              
2             package PRANG::Cookbook::Role::Time;
3             $PRANG::Cookbook::Role::Time::VERSION = '0.20';
4 1     1   2171 use Moose::Role;
  1         3  
  1         8  
5 1     1   4684 use PRANG::Graph;
  0            
  0            
6             use Moose::Util::TypeConstraints;
7              
8             subtype 'PRANG::Cookbook::Hour'
9             => as 'Int',
10             => where {
11             $_ >= 1 and $_ <= 24;
12             };
13              
14             subtype 'PRANG::Cookbook::Minute'
15             => as 'Int',
16             => where {
17             $_ >= 1 and $_ <= 60;
18             };
19              
20             subtype 'PRANG::Cookbook::Second'
21             => as 'Int',
22             => where {
23             $_ >= 1 and $_ <= 60;
24             };
25              
26             has_attr 'hour' =>
27             is => 'rw',
28             isa => 'PRANG::Cookbook::Hour',
29             xml_required => 1,
30             ;
31              
32             has_attr 'minute' =>
33             is => 'rw',
34             isa => 'PRANG::Cookbook::Minute',
35             xml_required => 1,
36             ;
37              
38             has_attr 'second' =>
39             is => 'rw',
40             isa => 'PRANG::Cookbook::Second',
41             xml_required => 0,
42             default => 0,
43             ;
44              
45             1;