File Coverage

blib/lib/Net/Posterous/Object.pm
Criterion Covered Total %
statement 3 10 30.0
branch 0 2 0.0
condition 0 3 0.0
subroutine 1 3 33.3
pod 1 1 100.0
total 5 19 26.3


line stmt bran cond sub pod time code
1             package Net::Posterous::Object;
2              
3 1     1   79175 use Class::Accessor "antlers";
  1         3575  
  1         8  
4              
5             =head1 NAME
6              
7             Net::Posterous::Object - base class for Net::Posterous objects
8              
9             =head1 METHODS
10              
11             =cut
12              
13             =head2 new
14              
15             Basic constructor.
16              
17             =cut
18             sub new {
19 0     0 1   my $class = shift;
20 0           my %opts = @_;
21 0           return bless \%opts, $class;
22             }
23              
24             sub _handle_datetime {
25 0     0     my $self = shift;
26             # Make sure date is in RFC822 format e.g Sun, 03 May 2009 19:58:58 -0700
27 0   0       $self->{_strp} ||= DateTime::Format::Strptime->new( pattern => "%a, %d %b %Y %H:%M:%S %z");
28              
29 0 0         $self->date($self->{_strp}->format_datetime(shift)) if @_;
30 0           return $self->{_strp}->parse_datetime($self->date);
31            
32             }
33              
34             1;