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   58 use Data::Dumper;
  8         18  
  8         558  
5              
6             use Class::MethodMaker [
7            
8 8         57 scalar => [ qw/ base subject language URI qname attrs parent children xtext text / ],
9 8     8   51 ];
  8         19  
10              
11             our
12             $VERSION = 1.31;
13              
14             sub new {
15 105     105 0 1668 my ($class,$ns,$prefix,$name,$parent,$attrs,%p) = @_;
16 105   33     408 my $self = bless {}, ref $class || $class;
17 105         192 my $base = $attrs->{base};
18 105   33     404 $base ||= $parent->{base};
19 105   33     391 $base ||= $p{base};
20 105         2370 $self->base($base);
21 105         3046 $self->URI($ns.$name);
22 105         2957 $self->qname($ns.':'.$name);
23 105         2838 $self->attrs($attrs);
24 105 50       2900 $self->parent($parent) if $parent;
25 105         2883 $self->xtext([]);
26 105         859 return $self;
27             }
28              
29             1;