DOM2/Element/Path.pm untested

filter: Statementstmt 0.0% 0 / 32 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 52 CC 4 SCAR 13.5
CC
4
Cov
0%
_attribute_handle
6.0
_has_attribute
6.0
instructions
6.0
CRAP 3.8
1 package SVG::DOM2::Element::Path;
2  
3 use base "SVG::DOM2::Element::Shape";
4 use base "SVG::DOM2::Element::Shape::Fill";
5 use base "SVG::DOM2::Element::Shape::Stroke";
6 use strict;
7 use warnings;
8  
9 use SVG::DOM2::Attribute::Path;
10  
11 sub new
12 {
13 my ($proto, %args) = @_;
14 my $self = $proto->SUPER::new('path', %args);
15 return $self;
16 }
17  
18 sub _attribute_handle
19 {
20 my ($self, $name, %opts) = @_;
21 if($name eq 'd') {
22 return SVG::DOM2::Attribute::Path->new(%opts);
23 }
24 return $self->SUPER::_attribute_handle($name, %opts);
25 }
26  
27 sub _has_attribute
28 {
29 my ($self, $name) = @_;
30 return 1 if($name eq 'd');
31 return $self->SUPER::_has_attribute($name);
32 }
33  
34 sub instructions
35 {
36 my ($self) = @_;
37 if($self->hasAttribute('d')) {
38 return $self->getAttribute('d')->instructions;
39 }
40 }
41  
42 return 1;