TPath/Predicate/Attribute.pm

filter: Statementstmt 66.6% 4 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 75.0% 6 / 8 CC 1 SCAR 1.4
CC
1
Cov
67%
BEGIN
1.3
BEGIN
1.0
CRAP 1.1
« TPath/Expression.pm ↑ Summary TPath/Predicate/AttributeTest.pm »
1 package TPath::Predicate::Attribute;
2 $TPath::Predicate::Attribute::VERSION = '1.007';
3 # ABSTRACT: implements the C<[@foo]> in C<//a/b[@foo]>
4  
5  
6 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 0 ▶use TPath::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=2.6
8  
9  
10 with 'TPath::Predicate';
11  
12  
13 has a => ( is => 'ro', isa => 'TPath::Attribute', required => 1 );
14  
15 sub filter {
16 my ( $self, $c ) = @_;
17 return grep { $self->a->test($_) } @$c;
18 }
19  
20 sub to_string {
21 $_[0]->a->to_string;
22 }
23  
24 __PACKAGE__->meta->make_immutable;
25  
26 1;
27  
28 __END__
« TPath/Expression.pm ↑ Summary TPath/Predicate/AttributeTest.pm »