| blib/lib/Graph/Grammar/Rule/Edge.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 10 | 10 | 100.0 |
| branch | n/a | ||
| condition | n/a | ||
| subroutine | 4 | 4 | 100.0 |
| pod | 0 | 2 | 0.0 |
| total | 14 | 16 | 87.5 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package Graph::Grammar::Rule::Edge; | ||||||
| 2 | |||||||
| 3 | # ABSTRACT: Rule to be evaluated on graph edges | ||||||
| 4 | our $VERSION = '0.2.0'; # VERSION | ||||||
| 5 | |||||||
| 6 | 2 | 2 | 12 | use strict; | |||
| 2 | 4 | ||||||
| 2 | 90 | ||||||
| 7 | 2 | 2 | 9 | use warnings; | |||
| 2 | 4 | ||||||
| 2 | 306 | ||||||
| 8 | |||||||
| 9 | sub new | ||||||
| 10 | { | ||||||
| 11 | 1 | 1 | 0 | 4 | my( $class, $code ) = @_; | ||
| 12 | 1 | 15 | return bless { code => $code }, $class; | ||||
| 13 | } | ||||||
| 14 | |||||||
| 15 | sub matches | ||||||
| 16 | { | ||||||
| 17 | 14 | 14 | 0 | 171 | my $self = shift; | ||
| 18 | 14 | 49 | return $self->{code}->( @_ ); | ||||
| 19 | } | ||||||
| 20 | |||||||
| 21 | 1; |