line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Translate::Fluent::Elements::Variant; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
41
|
use Moo; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
33
|
|
4
|
|
|
|
|
|
|
extends 'Translate::Fluent::Elements::Base'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
has [qw( |
7
|
|
|
|
|
|
|
identifier |
8
|
|
|
|
|
|
|
pattern |
9
|
|
|
|
|
|
|
)] => ( |
10
|
|
|
|
|
|
|
is => 'ro', |
11
|
|
|
|
|
|
|
default => sub { undef }, |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
around BUILDARGS => sub { |
15
|
|
|
|
|
|
|
my ($orig, $class, %args) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$args{identifier} = delete $args{ Identifier }; |
18
|
|
|
|
|
|
|
$args{pattern} = delete $args{ Pattern }; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$class->$orig( %args ); |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub translate { |
24
|
6
|
|
|
6
|
1
|
12
|
my ($self, $variables) = @_; |
25
|
|
|
|
|
|
|
|
26
|
6
|
|
|
|
|
26
|
return $self->pattern->translate( $variables ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |