File Coverage

blib/lib/Text/PORE/Node/Attr.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition 2 6 33.3
subroutine 3 3 100.0
pod 0 1 0.0
total 20 25 80.0


line stmt bran cond sub pod time code
1             # AttrNode -- construct containing type and attribute-value pairs
2             # ("abstract class")
3             # tag_type (scalar): type of tag
4             # pairs (hash): attribute-value pairs
5             package Text::PORE::Node::Attr;
6            
7 1     1   6 use Text::PORE::Node;
  1         2  
  1         28  
8 1     1   6 use strict;
  1         4  
  1         160  
9            
10             @Text::PORE::Node::Attr::ISA = qw(Text::PORE::Node);
11            
12             sub new {
13 33     33 0 45 my $type = shift;
14 33         114 my $lineno = shift;
15 33         43 my $tag_type = shift;
16 33         44 my $pairs = shift;
17            
18 33   33     142 my $self = bless {}, ref($type) || $type;
19            
20 33         179 $self = $self->SUPER::new($lineno);
21            
22 33         171 $self->{'tag_type'} = $tag_type;
23 33         62 $self->{'attrs'} = $pairs;
24             # TODO debugging
25             #print ("$lineno ", map ("$_:$$pairs{$_}\n", keys %$pairs));
26            
27 33   33     158 bless $self, ref($type) || $type;
28             }
29            
30             1;