| 1 | package Translate::Fluent::Elements::Argument; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 6 | ▶ | use Moo; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 6 | extends 'Translate::Fluent::Elements::Base'; | |||||||||||||
| 5 | |||||||||||||||
| 6 | has [qw( | ||||||||||||||
| 7 | named_argument | ||||||||||||||
| 8 | inline_expression | ||||||||||||||
| 9 | )] => ( | ||||||||||||||
| 10 | is => 'ro', | ||||||||||||||
| 11 | 0 | ▶ | default => sub { undef }, | ||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||
| 12 | 6 | ); | |||||||||||||
| 13 | |||||||||||||||
| 14 | 28 | ▶ | around BUILDARGS => sub { | ||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||
| 15 | 28 | my ($orig, $class, %args) = @_; | |||||||||||||
| 16 | |||||||||||||||
| 17 | 28 | $args{named_argument} = delete $args{ NamedArgument }; | |||||||||||||
| 18 | 28 | $args{inline_expression} = delete $args{ InlineExpression }; | |||||||||||||
| 19 | |||||||||||||||
| 20 | 28 | $class->$orig( %args ); | |||||||||||||
| 21 | 6 | }; | |||||||||||||
| 22 | |||||||||||||||
| 23 | 15 | ▶ | sub identifier { | ||||||||||||
|
Subroutine
identifier: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||
| 24 | 15 | my ($self) = @_; | |||||||||||||
| 25 | |||||||||||||||
| 26 | 15 | ▶ | if ($self->named_argument) { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 27 | 12 | return $self->named_argument->identifier; | |||||||||||||
| 28 | } | ||||||||||||||
| 29 | |||||||||||||||
| 30 | 3 | return; | |||||||||||||
| 31 | } | ||||||||||||||
| 32 | |||||||||||||||
| 33 | 15 | ▶ | sub translate { | ||||||||||||
|
Subroutine
translate: called CC=3 SCAR=11.3
Pod
documented
| |||||||||||||||
| 34 | 15 | my ($self, $variables) = @_; | |||||||||||||
| 35 | |||||||||||||||
| 36 | 15 | ▶ | if ($self->named_argument) { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 37 | 12 | return $self->named_argument->translate( $variables ); | |||||||||||||
| 38 | } elsif ($self->inline_expression) { | ||||||||||||||
| 39 | 3 | return $self->inline_expression->translate( $variables ); | |||||||||||||
| 40 | } | ||||||||||||||
| 41 | |||||||||||||||
| 42 | 0 | return; | |||||||||||||
| 43 | } | ||||||||||||||
| 44 | |||||||||||||||
| 45 | |||||||||||||||
| 46 | 6 | 1; | |||||||||||||
| 47 | |||||||||||||||
| 48 | __END__ | ||||||||||||||