« blib/lib/Salvation/TC/Meta/Type/Parameterized/ArrayRef.pm
↑ Summary
blib/lib/Salvation/TC/Type/SessionId.pm »
| 1 | package Salvation::TC::Meta::Type::Parameterized::HashRef; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | =head1 NAME | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | Salvation::TC::Meta::Type::Parameterized::HashRef - Класс для типа параметризованного HashRef. | ||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | =cut | ||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 3 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 3 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 3 | ▶ | use boolean; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 3 | ▶ | use Scalar::Util 'blessed'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | 3 | ▶ | use base 'Salvation::TC::Meta::Type::Parameterized'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | =head1 METHODS | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | =cut | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | =head2 iterate( HashRef $value, CodeRef $code ) | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | =cut | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | sub iterate { | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 29 | ▶ | my ( $self, $value, $code ) = @_; | ||||||||||||||||||
|
Subroutine
iterate: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||
| 27 | 29 | my %clone = (); | |||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 29 | ▶ | while( my ( $key, $item ) = each( %$value ) ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 33 | ▶ | eval { $code -> ( $item, $key, sub { $clone{ $key } = $_[ 0 ] } ) }; | ||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=0.4
| |||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 33 | ▶ | if( $@ ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 16 | keys( %$value ); # сбрасываем итератор | |||||||||||||||||||
| 36 | 16 | die( $@ ); | |||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 13 | return \%clone; | |||||||||||||||||||
| 41 | } | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | =head2 signed_type_generator() | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | =cut | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | sub signed_type_generator { | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 2 | ▶ | my ( $self ) = @_; | ||||||||||||||||||
|
Subroutine
signed_type_generator: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 2 | ▶ | return $self -> { 'signed_type_generator' } //= Salvation::TC -> get( 'HashRef' ) -> signed_type_generator(); | ||||||||||||||||||
|
Condition66%2/3
$self->{"signed_type_generator"} //= "Salvation::TC"->get("HashRef")->signed_type_generator
MC/DC0%0/2
$self->{"signed_type_generator"} //= "Salvation::TC"->get("HashRef")->signed_type_generator
$self->{"signed_type_generator"}
"Salvation::TC"->get("HashRef")->signed_type_generator
Truth table66%2/3
A //= B
A= $self->{"signed_type_generator"}B= "Salvation::TC"->get("HashRef")->signed_type_generator
| |||||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | 3 | 1; | |||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | __END__ | ||||||||||||||||||||