| 1 | package Data::Decode::Types; | ||||||||||
| 2 | 7 | ▶ | use Moose::Util::TypeConstraints; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 7 | ▶ | use namespace::clean -except => qw(meta); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | subtype 'Data::Decode::Decoder' | ||||||||||
| 6 | => as 'Object' | ||||||||||
| 7 | 13 | ▶ | => where { $_->can('decode') } | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 0 | ▶ | => message { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 9 | 0 | "$_ does not implement a method named decode()" | |||||||||
| 10 | } | ||||||||||
| 11 | 7 | ; | |||||||||
| 12 | |||||||||||
| 13 | coerce 'Data::Decode::Decoder' | ||||||||||
| 14 | => from 'ArrayRef', | ||||||||||
| 15 | 1 | ▶ | => via { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 1 | Class::MOP::load_class('Data::Decode::Chain'); | |||||||||
| 17 | 1 | Data::Decode::Chain->new(decoders => $_) | |||||||||
| 18 | } | ||||||||||
| 19 | 7 | ; | |||||||||
| 20 | |||||||||||
| 21 | 7 | subtype 'Data::Decode::DecoderList' | |||||||||
| 22 | => as 'ArrayRef[Data::Decode::Decoder]' | ||||||||||
| 23 | ; | ||||||||||
| 24 | |||||||||||
| 25 | coerce 'Data::Decode::DecoderList' | ||||||||||
| 26 | => from 'ArrayRef' | ||||||||||
| 27 | 1 | ▶ | => via { | ||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.2
| |||||||||||
| 28 | 1 | my @list = @$_; | |||||||||
| 29 | return [ | ||||||||||
| 30 | map { | ||||||||||
| 31 | 1 | Class::MOP::blessed $_ ? $_ : | |||||||||
| 32 | 2 | ▶ | do { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | 2 | ▶ | if (!s/^\+//) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | 2 | $_ = "Data::Decode::$_"; | |||||||||
| 35 | } | ||||||||||
| 36 | 2 | Class::MOP::load_class($_); | |||||||||
| 37 | 2 | $_->new(); | |||||||||
| 38 | } | ||||||||||
| 39 | } @list | ||||||||||
| 40 | ] | ||||||||||
| 41 | } | ||||||||||
| 42 | 7 | ; | |||||||||
| 43 | |||||||||||
| 44 | 7 | 1; | |||||||||