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