File Coverage

blib/lib/XML/Atom/Syndication/Source.pm
Criterion Covered Total %
statement 15 15 100.0
branch 3 4 75.0
condition n/a
subroutine 4 4 100.0
pod 1 2 50.0
total 23 25 92.0


line stmt bran cond sub pod time code
1             package XML::Atom::Syndication::Source;
2 4     4   1473 use strict;
  4         8  
  4         188  
3              
4 4     4   24 use base qw( XML::Atom::Syndication::Thing );
  4         8  
  4         1279  
5              
6             XML::Atom::Syndication::Source->mk_accessors('element', 'icon', 'logo');
7             XML::Atom::Syndication::Source->mk_accessors(
8             'XML::Atom::Syndication::Generator',
9             'generator');
10             XML::Atom::Syndication::Source->mk_accessors('XML::Atom::Syndication::Text',
11             'subtitle');
12              
13 4     4 1 18 sub element_name { 'source' }
14              
15             # This is the init method in XML::Atom::Syndication::Object. Could do
16             # better.
17             sub init {
18 11     11 0 21 my $atom = shift;
19 11 50       63 my %param = @_ == 1 ? (Elem => $_[0]) : @_;
20 11         57 $atom->set_ns(\%param);
21 11 100       51 unless ($atom->{elem} = $param{Elem}) {
22 3         968 require XML::Elemental::Element;
23 3         497 $atom->{elem} = XML::Elemental::Element->new;
24 3         49 $atom->{elem}->name('{' . $atom->ns . '}' . $atom->element_name);
25             }
26 11         58 $atom;
27             }
28              
29             1;
30              
31             __END__