File Coverage

blib/lib/REST/Google/Feeds.pm
Criterion Covered Total %
statement 27 30 90.0
branch 1 2 50.0
condition n/a
subroutine 9 9 100.0
pod 1 1 100.0
total 38 42 90.4


line stmt bran cond sub pod time code
1             #
2             # $Id: Feeds.pm 13 2008-04-30 09:30:13Z esobchenko $
3              
4             package REST::Google::Feeds;
5              
6 2     2   41397 use strict;
  2         4  
  2         88  
7 2     2   11 use warnings;
  2         2  
  2         64  
8              
9 2     2   1077 use version; our $VERSION = qv('1.0.8');
  2         2898  
  2         14  
10              
11             require Exporter;
12             require REST::Google;
13 2     2   215 use base qw/Exporter REST::Google/;
  2         4  
  2         1043  
14              
15             __PACKAGE__->service('http://ajax.googleapis.com/ajax/services/feed/load');
16              
17             sub responseData {
18 1     1 1 1063 my $self = shift;
19 1         11 return bless $self->{responseData}, 'REST::Google::Feeds::Data';
20             }
21              
22             package # hide from CPAN
23             REST::Google::Feeds::Data;
24              
25             sub feed {
26 1     1   2 my $self = shift;
27 1         14 return bless $self->{feed}, 'REST::Google::Feeds::Feed';
28             }
29              
30             package # hide from CPAN
31             REST::Google::Feeds::Feed;
32              
33             require Class::Accessor;
34 2     2   13 use base qw/Class::Accessor/;
  2         76  
  2         514  
35              
36             {
37             my @fields = qw(
38             title
39             link
40             author
41             description
42             type
43             );
44              
45             __PACKAGE__->mk_ro_accessors(@fields);
46             }
47              
48             sub entries {
49 1     1   1967 my $self = shift;
50 1 50       7 if (wantarray) {
51 0         0 return map { bless $_, 'REST::Google::Feeds::Entry' } @{ $self->{entries} };
  0         0  
  0         0  
52             }
53 1         3 [ map { bless $_, 'REST::Google::Feeds::Entry' } @{ $self->{entries} } ];
  4         14  
  1         12  
54             }
55              
56             package # hide from CPAN
57             REST::Google::Feeds::Entry;
58              
59             require Class::Accessor;
60 2     2   11 use base qw/Class::Accessor/;
  2         4  
  2         223  
61              
62             {
63             my @fields = qw(
64             title
65             link
66             author
67             publishedDate
68             contentSnippet
69             content
70             categories
71             );
72              
73             __PACKAGE__->mk_ro_accessors(@fields);
74             }
75              
76             1;