| 1 | |||||||||||||||
| 2 | package Email::Blaster::ConfigNode; | ||||||||||||||
| 3 | |||||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 2 | ▶ | use warnings 'all'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | 2 | ▶ | use Carp 'confess'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | |||||||||||||||
| 8 | |||||||||||||||
| 9 | #============================================================================== | ||||||||||||||
| 10 | sub new | ||||||||||||||
| 11 | 0 | ▶ | { | ||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 12 | 0 | my ($class, $ref) = @_; | |||||||||||||
| 13 | 0 | local $SIG{__DIE__} = \&Carp::confess; | |||||||||||||
| 14 | 0 | my $s = bless $ref, $class; | |||||||||||||
| 15 | 0 | $s->init_keys(); | |||||||||||||
| 16 | 0 | $s; | |||||||||||||
| 17 | }# end new() | ||||||||||||||
| 18 | |||||||||||||||
| 19 | |||||||||||||||
| 20 | #============================================================================== | ||||||||||||||
| 21 | sub init_keys | ||||||||||||||
| 22 | 0 | ▶ | { | ||||||||||||
|
Subroutine
init_keys: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||
| 23 | 0 | my $s = shift; | |||||||||||||
| 24 | |||||||||||||||
| 25 | 0 | foreach my $key ( grep { ref($s->{$_}) eq 'HASH' } keys(%$s) ) | |||||||||||||
| 26 | { | ||||||||||||||
| 27 | 0 | ▶ | if( $key eq 'throttled' ) | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 28 | { | ||||||||||||||
| 29 | 0 | require Email::Blaster::ConfigNode::Throttled; | |||||||||||||
| 30 | 0 | $s->{$key} = Email::Blaster::ConfigNode::Throttled->new( delete($s->{$key}) ); | |||||||||||||
| 31 | } | ||||||||||||||
| 32 | elsif( $key eq 'cluster' ) | ||||||||||||||
| 33 | { | ||||||||||||||
| 34 | 0 | require Email::Blaster::ConfigNode::Cluster; | |||||||||||||
| 35 | 0 | $s->{$key} = Email::Blaster::ConfigNode::Cluster->new( delete($s->{$key}) ); | |||||||||||||
| 36 | } | ||||||||||||||
| 37 | else | ||||||||||||||
| 38 | { | ||||||||||||||
| 39 | 0 | $s->{$key} = __PACKAGE__->new( $s->{$key} ); | |||||||||||||
| 40 | }# end if() | ||||||||||||||
| 41 | }# end foreach() | ||||||||||||||
| 42 | }# end init_keys() | ||||||||||||||
| 43 | |||||||||||||||
| 44 | |||||||||||||||
| 45 | #============================================================================== | ||||||||||||||
| 46 | sub AUTOLOAD | ||||||||||||||
| 47 | 0 | ▶ | { | ||||||||||||
|
Subroutine
AUTOLOAD: not called CC=3 SCAR=24.8
| |||||||||||||||
| 48 | 0 | my $s = shift; | |||||||||||||
| 49 | 0 | our $AUTOLOAD; | |||||||||||||
| 50 | 0 | my ($name) = $AUTOLOAD =~ m/([^:]+)$/; | |||||||||||||
| 51 | |||||||||||||||
| 52 | 0 | ▶ | confess "Unknown method or property '$name'" unless exists($s->{$name}); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 53 | |||||||||||||||
| 54 | # Setter/Getter: | ||||||||||||||
| 55 | 0 | ▶ | @_ ? $s->{$name} = shift : $s->{$name}; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 56 | }# end AUTOLOAD() | ||||||||||||||
| 57 | |||||||||||||||
| 58 | |||||||||||||||
| 59 | #============================================================================== | ||||||||||||||
| 60 | sub DESTROY | ||||||||||||||
| 61 | 0 | ▶ | { | ||||||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=6.9
| |||||||||||||||
| 62 | 0 | my $s = shift; | |||||||||||||
| 63 | 0 | undef(%$s); | |||||||||||||
| 64 | }# end DESTROY() | ||||||||||||||
| 65 | |||||||||||||||
| 66 | 2 | 1;# return true: | |||||||||||||
| 67 | |||||||||||||||
| 68 | |||||||||||||||