TPath/Selector/Test/AxisAttribute.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« TPath/Selector/Test/AnywhereAttribute.pm ↑ Summary TPath/Selector/Test/ChildAttribute.pm »
1 package TPath::Selector::Test::AxisAttribute;
2 $TPath::Selector::Test::AxisAttribute::VERSION = '1.007';
3 # ABSTRACT: handles C</ancestor::@foo> or C</preceding::@foo> where this is not the first step in the path, or C<ancestor::@foo>, etc.
4  
5 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use TPath::Test::Node::Attribute;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 0 ▶use TPath::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=2.6
8 use namespace::autoclean;
9  
10  
11 with 'TPath::Selector::Test';
12  
13 has a => ( is => 'ro', isa => 'TPath::Attribute', required => 1 );
14  
15 sub BUILD {
16 my $self = shift;
17 my $nt = TPath::Test::Node::Attribute->new( a => $self->a );
18 $self->_node_test($nt);
19 }
20  
21 sub to_string {
22 my ( $self, $first ) = @_;
23 my $s = $first ? '' : '/';
24 $s .= $self->axis . '::';
25 $s .= '^' if $self->is_inverted;
26 $s .= $self->a->to_string;
27 return $s;
28 }
29  
30 __PACKAGE__->meta->make_immutable;
31  
32 1;
33  
34 __END__
« TPath/Selector/Test/AnywhereAttribute.pm ↑ Summary TPath/Selector/Test/ChildAttribute.pm »