File Coverage

blib/lib/WebService/Blogger/AtomReading.pm
Criterion Covered Total %
statement 9 14 64.2
branch 0 2 0.0
condition 0 6 0.0
subroutine 3 4 75.0
pod 1 1 100.0
total 13 27 48.1


line stmt bran cond sub pod time code
1             package WebService::Blogger::AtomReading;
2             our $VERSION = '0.23';
3 2     2   1301 use warnings;
  2         6  
  2         72  
4 2     2   12 use strict;
  2         11  
  2         50  
5              
6 2     2   991 use Moose::Role;
  2         10983  
  2         9  
7              
8             sub get_link_href_by_rel {
9             ## Returns "href" attribute of the first element of type "link" in
10             ## given tree generated from Atom entry using XML::Simple.
11 0     0 1   my $self = shift;
12 0           my ($tree, $rel_value) = @_;
13              
14 0           foreach my $link (@{ $tree->{link} }) {
  0            
15             return $link->{href} if ref($rel_value) && $link->{rel} =~ $rel_value
16 0 0 0       || $link->{rel} eq $rel_value;
      0        
17             }
18             }
19              
20             1;
21              
22             __END__
23              
24             =head1 NAME
25              
26             WebService::Blogger::AtomReading - Role providing common methods for
27             reading Atom entries.
28              
29             =head1 SYNOPSIS
30              
31             Not designed to be used independently. Please see
32             L<WebService::Blogger> for usage instructions for the package.
33              
34             =head1 METHODS
35              
36             =over 1
37              
38             =item get_link_href_by_rel($tree, $rel_value)
39              
40             Returns value of "href" attribute of "link" node with given "rel"
41             attribute value. First argument is data structure resulting from
42             parsing Atom feed with XML::Simple.
43              
44             =back
45              
46             =head1 AUTHOR
47              
48             Kedar Warriner, C<< <kedar at cpan.org> >>
49              
50             =head1 BUGS
51              
52             Please report any bugs or feature requests to C<bug-net-google-api-blogger at rt.cpan.org>, or through
53             the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-Blogger>. I will be notified, and then you'll
54             automatically be notified of progress on your bug as I make changes.
55              
56             =head1 SUPPORT
57              
58             You can find documentation for this module with the perldoc command.
59              
60             perldoc WebService::Blogger
61              
62             You can also look for information at:
63              
64             =over 4
65              
66             =item * RT: CPAN's request tracker
67              
68             L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=WebService-Blogger>
69              
70             =item * AnnoCPAN: Annotated CPAN documentation
71              
72             L<http://annocpan.org/dist/WebService-Blogger>
73              
74             =item * CPAN Ratings
75              
76             L<http://cpanratings.perl.org/d/WebService-Blogger>
77              
78             =item * Search CPAN
79              
80             L<http://search.cpan.org/dist/WebService-Blogger/>
81              
82             =back
83              
84             =head1 ACKNOWLEDGEMENTS
85              
86             Many thanks to:
87             - Egor Shipovalov who wrote the original version of this module
88             - Everyone involved with CPAN.
89              
90             =head1 LICENSE AND COPYRIGHT
91              
92             Copyright 2010 Kedar Warriner.
93              
94             This program is free software; you can redistribute it and/or modify it
95             under the terms of either: the GNU General Public License as published
96             by the Free Software Foundation; or the Artistic License.
97              
98             See http://dev.perl.org/licenses/ for more information.
99              
100             =cut