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