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 1 2 50.0
total 20 26 76.9


line stmt bran cond sub pod time code
1             package XML::Atom::Syndication::Generator;
2 2     2   354 use strict;
  2         1  
  2         52  
3              
4 2     2   5 use base qw( XML::Atom::Syndication::Object );
  2         3  
  2         145  
5 2     2   8 use XML::Elemental::Characters;
  2         3  
  2         210  
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 3 sub element_name { 'generator' }
12              
13             sub agent {
14 1     1 0 316 my $e = $_[0]->elem;
15 1 50       2 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         4 $e->text_content;
22             }
23             }
24              
25             1;
26              
27             __END__