File Coverage

blib/lib/XML/Atom/Entry.pm
Criterion Covered Total %
statement 4 6 66.6
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 6 8 75.0


line stmt bran cond sub pod time code
1             # $Id$
2              
3             package XML::Atom::Entry;
4 4     4   106652 use strict;
  4         11  
  4         152  
5              
6 4     4   1430 use XML::Atom;
  0            
  0            
7             use base qw( XML::Atom::Thing );
8             use MIME::Base64 qw( encode_base64 decode_base64 );
9             use XML::Atom::Person;
10             use XML::Atom::Content;
11             use XML::Atom::Util qw( first );
12              
13             sub element_name { 'entry' }
14              
15             sub content {
16             my $entry = shift;
17             if (my @arg = @_) {
18             if (ref($arg[0]) ne 'XML::Atom::Content') {
19             $arg[0] = XML::Atom::Content->new(Body => $arg[0], Version => $entry->version);
20             }
21             $entry->set($entry->ns, 'content', @arg);
22             } else {
23             return $entry->get_object($entry->ns, 'content', 'XML::Atom::Content');
24             }
25             }
26              
27             __PACKAGE__->mk_elem_accessors(qw( summary ));
28             __PACKAGE__->mk_xml_attr_accessors(qw( lang base ));
29              
30             __PACKAGE__->_rename_elements('issued' => 'published');
31             __PACKAGE__->_rename_elements('modified' => 'updated');
32              
33             # OMG 0.3 elements ... to be backward compatible
34             __PACKAGE__->mk_elem_accessors(qw( created ));
35              
36             __PACKAGE__->mk_object_accessor( source => 'XML::Atom::Feed' );
37              
38             1;
39             __END__