| blib/lib/Template/Plugin/Map.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 12 | 12 | 100.0 |
| branch | n/a | ||
| condition | n/a | ||
| subroutine | 4 | 4 | 100.0 |
| pod | 0 | 1 | 0.0 |
| total | 16 | 17 | 94.1 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package Template::Plugin::Map; | ||||||
| 2 | $Template::Plugin::Map::VERSION = '0.02'; | ||||||
| 3 | # ABSTRACT: map VMethod for Template::Tookit | ||||||
| 4 | |||||||
| 5 | 1 | 1 | 83652 | use strict; | |||
| 1 | 3 | ||||||
| 1 | 39 | ||||||
| 6 | 1 | 1 | 5 | use warnings; | |||
| 1 | 2 | ||||||
| 1 | 35 | ||||||
| 7 | 1 | 1 | 5 | use base 'Template::Plugin::VMethods'; | |||
| 1 | 2 | ||||||
| 1 | 990 | ||||||
| 8 | |||||||
| 9 | our @LIST_OPS = (map => \&map_list); | ||||||
| 10 | |||||||
| 11 | sub map_list { | ||||||
| 12 | 2 | 2 | 0 | 3194 | my ($list, $method) = @_; | ||
| 13 | |||||||
| 14 | 2 | 5 | [map { $_->$method } @$list]; | ||||
| 4 | 57 | ||||||
| 15 | } | ||||||
| 16 | |||||||
| 17 | 1; | ||||||
| 18 | |||||||
| 19 | __END__ |