blib/lib/Jmespath/Visitor.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 6 | 15 | 40.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 2 | 5 | 40.0 |
pod | 0 | 3 | 0.0 |
total | 8 | 23 | 34.7 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Jmespath::Visitor; | ||||||
2 | 1 | 1 | 3 | use strict; | |||
1 | 1 | ||||||
1 | 19 | ||||||
3 | 1 | 1 | 2 | use warnings; | |||
1 | 1 | ||||||
1 | 101 | ||||||
4 | #no strict 'refs'; | ||||||
5 | |||||||
6 | sub new { | ||||||
7 | 0 | 0 | 0 | my ($class) = @_; | |||
8 | 0 | my $self = bless {}, $class; | |||||
9 | 0 | $self->{_method_cache} = {}; | |||||
10 | 0 | return $self; | |||||
11 | } | ||||||
12 | |||||||
13 | sub visit { | ||||||
14 | 0 | 0 | 0 | my ($self, $node, $args) = @_; | |||
15 | 0 | my $node_type = $node->{type}; | |||||
16 | 0 | my $method = 'visit_' . $node->{type}; | |||||
17 | 0 | return &$method; | |||||
18 | } | ||||||
19 | |||||||
20 | 0 | 0 | 0 | sub default_visit { ... } | |||
21 | |||||||
22 | 1; |