| 1 | package TPath::Selector::Test::ClosestTag; | ||||||||||
| 2 | $TPath::Selector::Test::ClosestTag::VERSION = '1.007'; | ||||||||||
| 3 | # ABSTRACT: handles C</E<gt>foo> | ||||||||||
| 4 | |||||||||||
| 5 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use TPath::Test::Node::Tag; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | |||||||||||
| 10 | with 'TPath::Selector::Test'; | ||||||||||
| 11 | |||||||||||
| 12 | has tag => ( is => 'ro', isa => 'Str', required => 1 ); | ||||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | sub BUILD { | ||||||||
|
Subroutine
BUILD: not called CC=1 SCAR=6.9
| |||||||||||
| 15 | 0 | my $self = shift; | |||||||||
| 16 | 0 | $self->_node_test( TPath::Test::Node::Tag->new( tag => $self->tag ) ); | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | # required by TPath::Selector::Test | ||||||||||
| 20 | 0 | ▶ | sub candidates { | ||||||||
|
Subroutine
candidates: not called CC=1 SCAR=6.9
| |||||||||||
| 21 | 0 | my ( $self, $ctx, $first ) = @_; | |||||||||
| 22 | 0 | return $ctx->i->f->closest( $ctx, $self->node_test, !$first ); | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub to_string { | ||||||||
|
Subroutine
to_string: not called CC=2 SCAR=17.9
| |||||||||||
| 26 | 0 | my $self = shift; | |||||||||
| 27 | return | ||||||||||
| 28 | 0 | ▶ | '/>' | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | . ( $self->is_inverted ? '^' : '' ) | ||||||||||
| 30 | . $self->_stringify_label( $self->tag ); | ||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | __PACKAGE__->meta->make_immutable; | ||||||||||
| 34 | |||||||||||
| 35 | 1; | ||||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||