line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Translate::Fluent::Elements::InlinePlaceable; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
39
|
use Moo; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
33
|
|
4
|
|
|
|
|
|
|
extends 'Translate::Fluent::Elements::Base'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has [qw(select_expression inline_expression)] => ( |
7
|
|
|
|
|
|
|
is => 'ro', |
8
|
|
|
|
|
|
|
default => sub { undef }, |
9
|
|
|
|
|
|
|
); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
around BUILDARGS => sub { |
12
|
|
|
|
|
|
|
my ($orig, $class, %args) = @_; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
$args{inline_expression} = delete $args{InlineExpression} |
15
|
|
|
|
|
|
|
if $args{InlineExpression}; |
16
|
|
|
|
|
|
|
$args{select_expression} = delete $args{SelectExpression} |
17
|
|
|
|
|
|
|
if $args{SelectExpression}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
$class->$orig( %args ); |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub translate { |
23
|
36
|
|
|
36
|
1
|
54
|
my ($self, $variables) = @_; |
24
|
|
|
|
|
|
|
|
25
|
36
|
100
|
|
|
|
119
|
if ($self->select_expression) { |
|
|
50
|
|
|
|
|
|
26
|
6
|
|
|
|
|
24
|
$self->select_expression->translate( $variables ); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
} elsif ($self->inline_expression) { |
29
|
30
|
|
|
|
|
78
|
$self->inline_expression->translate( $variables ); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
} else { |
32
|
0
|
|
|
|
|
|
return ''; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |