Meerkat/DateTime.pm

filter: Statementstmt 93.5% 29 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod n/a totaltotal 92.5% 37 / 40 CC 1 SCAR 1.1
CC
1
Cov
94%
_build_DateTime
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Meerkat/Types.pm ↑ Summary
1 1 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Meerkat::DateTime;
6 # ABSTRACT: DateTime proxy for lazy inflation from an epoch value
7  
8 1 our $VERSION = '0.016';
9  
10 1 ▶use Moose 2;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use MooseX::AttributeShortcuts;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use MooseX::Storage;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 ▶use DateTime;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 with Storage;
18  
19 #pod =attr epoch (required)
20 #pod
21 #pod Floating point epoch seconds
22 #pod
23 #pod =cut
24  
25 1 has epoch => (
26 is => 'ro',
27 isa => 'Num',
28 required => 1,
29 );
30  
31 #pod =attr DateTime
32 #pod
33 #pod A lazily-inflated DateTime object. It will not be serialized by MooseX::Storage.
34 #pod
35 #pod =cut
36  
37 1 has DateTime => (
38 is => 'lazy',
39 isa => 'DateTime',
40 traits => ['DoNotSerialize'],
41 );
42  
43 0 ▶sub _build_DateTime {
Subroutine _build_DateTime: not called CC=1 SCAR=6.9
44 0 my ($self) = @_;
45 0 return DateTime->from_epoch( epoch => $self->epoch );
46 }
47  
48 1 __PACKAGE__->meta->make_immutable;
49  
50 1 1;
51  
52  
53 # vim: ts=4 sts=4 sw=4 et:
54  
55 __END__
« Meerkat/Types.pm ↑ Summary