| blib/lib/Translate/Fluent/Elements/VariableReference.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| statement | 5 | 5 | 100.0 |
| branch | n/a | ||
| condition | n/a | ||
| subroutine | 2 | 2 | 100.0 |
| pod | 1 | 1 | 100.0 |
| total | 8 | 8 | 100.0 |
| line | stmt | bran | cond | sub | pod | time | code |
|---|---|---|---|---|---|---|---|
| 1 | package Translate::Fluent::Elements::VariableReference; | ||||||
| 2 | |||||||
| 3 | 6 | 6 | 39 | use Moo; | |||
| 6 | 13 | ||||||
| 6 | 33 | ||||||
| 4 | extends 'Translate::Fluent::Elements::Base'; | ||||||
| 5 | |||||||
| 6 | has identifier => ( | ||||||
| 7 | is => 'ro', | ||||||
| 8 | default => sub { undef }, | ||||||
| 9 | ); | ||||||
| 10 | |||||||
| 11 | sub translate { | ||||||
| 12 | 12 | 12 | 1 | 23 | my ($self, $variables) = @_; | ||
| 13 | |||||||
| 14 | # use Data::Dumper; | ||||||
| 15 | # print STDERR Dumper($self, $variables); | ||||||
| 16 | |||||||
| 17 | 12 | 40 | return $variables->{ $self->identifier }; | ||||
| 18 | } | ||||||
| 19 | |||||||
| 20 | 1; | ||||||
| 21 | __END__ |