File Coverage

blib/lib/RDF/Simple/Parser/Element.pm
Criterion Covered Total %
statement 18 18 100.0
branch 1 2 50.0
condition 3 9 33.3
subroutine 3 3 100.0
pod 0 1 0.0
total 25 33 75.7


line stmt bran cond sub pod time code
1              
2             package RDF::Simple::Parser::Element;
3              
4 8     8   57 use Data::Dumper;
  8         29  
  8         534  
5              
6             use Class::MethodMaker [
7            
8 8         57 scalar => [ qw/ base subject language URI qname attrs parent children xtext text / ],
9 8     8   56 ];
  8         17  
10              
11             our
12             $VERSION = 1.31;
13              
14             sub new {
15 105     105 0 1768 my ($class,$ns,$prefix,$name,$parent,$attrs,%p) = @_;
16 105   33     425 my $self = bless {}, ref $class || $class;
17 105         204 my $base = $attrs->{base};
18 105   33     393 $base ||= $parent->{base};
19 105   33     385 $base ||= $p{base};
20 105         2462 $self->base($base);
21 105         3206 $self->URI($ns.$name);
22 105         3155 $self->qname($ns.':'.$name);
23 105         3025 $self->attrs($attrs);
24 105 50       3058 $self->parent($parent) if $parent;
25 105         2970 $self->xtext([]);
26 105         909 return $self;
27             }
28              
29             1;