| 1 | |||||||||||
| 2 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | package MetaPOD::Format::JSON::v1; | ||||||||||
| 6 | 5 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 5 | $MetaPOD::Format::JSON::v1::AUTHORITY = 'cpan:KENTNL'; | |||||||||
| 8 | } | ||||||||||
| 9 | { | ||||||||||
| 10 | 5 | $MetaPOD::Format::JSON::v1::VERSION = '0.3.0'; | |||||||||
| 11 | } | ||||||||||
| 12 | |||||||||||
| 13 | # ABSTRACT: MetaPOD::JSON v1 SPEC Implementation | ||||||||||
| 14 | |||||||||||
| 15 | 5 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | |||||||||||
| 17 | |||||||||||
| 18 | 5 | with 'MetaPOD::Format::JSON::Decoder::v1', | |||||||||
| 19 | 'MetaPOD::Format::JSON::PostCheck::v1', | ||||||||||
| 20 | 'MetaPOD::Format::JSON::does::v1', | ||||||||||
| 21 | 'MetaPOD::Format::JSON::inherits::v1', | ||||||||||
| 22 | 'MetaPOD::Format::JSON::namespace::v1'; | ||||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | 4 | ▶ | sub features { | ||||||||
|
Subroutine
features: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 26 | 4 | return qw( does inherits namespace ); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | |||||||||||
| 30 | 13 | ▶ | sub dispatch_keys { | ||||||||
|
Subroutine
dispatch_keys: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 31 | 13 | my ( $self, $data_decoded, $result ) = @_; | |||||||||
| 32 | 13 | for my $feature ( $self->features ) { | |||||||||
| 33 | 48 | my $method = 'add_' . $feature; | |||||||||
| 34 | 48 | ▶ | next unless exists $data_decoded->{$feature}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 31 | my $copy = delete $data_decoded->{$feature}; | |||||||||
| 36 | 31 | $self->$method( $copy, $result ); | |||||||||
| 37 | } | ||||||||||
| 38 | 13 | return $self; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | |||||||||||
| 42 | 13 | ▶ | sub add_segment { | ||||||||
|
Subroutine
add_segment: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 43 | 13 | my ( $self, $segment, $result ) = @_; | |||||||||
| 44 | 13 | my $data = $self->decode( $segment->{data} ); | |||||||||
| 45 | 13 | $self->dispatch_keys( $data, $result ); | |||||||||
| 46 | 13 | $self->postcheck($data); | |||||||||
| 47 | 13 | return $self; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 5 | 1; | |||||||||
| 51 | |||||||||||
| 52 | __END__ | ||||||||||