File Coverage

blib/lib/XML/Atom/Syndication/Generator.pm
Criterion Covered Total %
statement 13 17 76.4
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 2 2 100.0
total 21 26 80.7


line stmt bran cond sub pod time code
1             package XML::Atom::Syndication::Generator;
2 2     2   964 use strict;
  2         5  
  2         181  
3              
4 2     2   14 use base qw( XML::Atom::Syndication::Object );
  2         4  
  2         227  
5 2     2   12 use XML::Elemental::Characters;
  2         5  
  2         396  
6              
7             XML::Atom::Syndication::Generator->mk_accessors('attribute', 'uri', 'version');
8             XML::Atom::Syndication::Generator->mk_accessors('attribute', 'url')
9             ; # deprecated 0.3 accessors
10              
11 1     1 1 44 sub element_name { 'generator' }
12              
13             sub agent {
14 1     1 1 427 my $e = $_[0]->elem;
15 1 50       4 if (@_ > 1) {
16 0         0 my $chars = XML::Elemental::Characters->new;
17 0         0 $chars->data($_[1]);
18 0         0 $chars->parent($e);
19 0         0 $e->contents([$chars]);
20             } else {
21 1         6 $e->text_content;
22             }
23             }
24              
25             1;
26              
27             __END__