| 1 | package Articulate::Augmentation::Interpreter; | ||||||||||||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | ▶ | use Moo; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 1 | ▶ | use Articulate::Syntax qw(instantiate instantiate_array); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 1 | has default_format => | |||||||||||||||||||
| 9 | is => 'rw'; | ||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | has interpreters => | ||||||||||||||||||||
| 12 | is => 'rw', | ||||||||||||||||||||
| 13 | 0 | ▶ | default => sub { {} }, | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 14 | coerce => sub { | ||||||||||||||||||||
| 15 | 0 | ▶ | my $interpreters = shift; | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||||
| 16 | 0 | foreach my $type (keys %$interpreters){ | |||||||||||||||||||
| 17 | 0 | $interpreters->{$type} = instantiate_array( $interpreters->{$type} ); | |||||||||||||||||||
| 18 | } | ||||||||||||||||||||
| 19 | 0 | return $interpreters; | |||||||||||||||||||
| 20 | 1 | }; | |||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | sub augment { | ||||||||||||||||||||
| 23 | 0 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
augment: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||
| 24 | 0 | my $item = shift; | |||||||||||||||||||
| 25 | 0 | my $format = $self->default_format; | |||||||||||||||||||
| 26 | 0 | foreach my $f ( keys %{ $self->interpreters } ) { | |||||||||||||||||||
| 27 | 0 | ▶ | if ( ( $item->meta->{schema}->{core}->{format} // '' ) eq $f ) { | ||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$item->meta->{"schema"}{"core"}{"format"} // ""
MC/DC0%0/1
$item->meta->{"schema"}{"core"}{"format"} // ""
$item->meta->{"schema"}{"core"}{"format"}
Truth table0%0/2
A
A= $item->meta->{"schema"}{"core"}{"format"}
| |||||||||||||||||||||
| 28 | 0 | $format = $f; | |||||||||||||||||||
| 29 | 0 | last; | |||||||||||||||||||
| 30 | } | ||||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | 0 | foreach my $interpreter ( @{ $self->interpreters->{$format} } ) { | |||||||||||||||||||
| 33 | 0 | $interpreter->augment($item); | |||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | 0 | return $item; | |||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 1 | 1; | |||||||||||||||||||