| 1 | package TPath::Predicate::Boolean; | ||
| 2 | $TPath::Predicate::Boolean::VERSION = '1.007'; | ||
| 3 | # ABSTRACT: implements the C<[@foo or @bar ]> in C<//a/b[@foo or @bar]> | ||
| 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 t => ( is => 'ro', does => 'TPath::Test', required => 1 ); | ||
| 14 | |||
| 15 | sub filter { | ||
| 16 | my ( $self, $c ) = @_; | ||
| 17 | return grep { $self->t->test($_) } @$c; | ||
| 18 | } | ||
| 19 | |||
| 20 | sub to_string { $_[0]->t->to_string } | ||
| 21 | |||
| 22 | __PACKAGE__->meta->make_immutable; | ||
| 23 | |||
| 24 | 1; | ||
| 25 | |||
| 26 | __END__ | ||