| 1 | package Bot::ChatBots::Weak; | ||||||||||||||||||||||||||||
| 2 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 6 | { our $VERSION = '0.014'; } | |||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 6 | ▶ | use Scalar::Util qw< weaken >; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | sub clone { | ||||||||||||||||||||||||||
|
Subroutine
clone: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 9 | 1 | my $self = shift; | |||||||||||||||||||||||||||
| 10 | 1 | return ref($self)->new($self); | |||||||||||||||||||||||||||
| 11 | } | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 1 | ▶ | sub get { | ||||||||||||||||||||||||||
|
Subroutine
get: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 14 | 1 | my ($self, $key) = @_; | |||||||||||||||||||||||||||
| 15 | 1 | return $self->{$key}; | |||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 1 | ▶ | sub get_multiple { | ||||||||||||||||||||||||||
|
Subroutine
get_multiple: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 19 | 1 | my $self = shift; | |||||||||||||||||||||||||||
| 20 | 1 | return @{$self}{@_}; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 8 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 24 | 8 | my $package = shift; | |||||||||||||||||||||||||||
| 25 | 8 | my $self = bless {}, $package; | |||||||||||||||||||||||||||
| 26 | 8 | return $self->set(@_); | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 26 | ▶ | sub set { | ||||||||||||||||||||||||||
|
Subroutine
set: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||
| 30 | 26 | my $self = shift; | |||||||||||||||||||||||||||
| 31 | 26 | ▶ | my @args = (@_ && ref($_[0])) ? %{$_[0]} : @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@_ and ref $_[0]
MC/DC100%2/2
@_ and ref $_[0]
@_
ref $_[0]
Truth table100%3/3
A and B
A= @_B= ref $_[0]
| |||||||||||||||||||||||||||||
| 32 | 26 | ▶ | while (@args) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 33 | 23 | my ($key, $value) = splice @args, 0, 2; | |||||||||||||||||||||||||||
| 34 | 23 | $self->{$key} = $value; | |||||||||||||||||||||||||||
| 35 | 23 | ▶ | weaken($self->{$key}) if ref $value; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||
| 37 | 26 | return $self; | |||||||||||||||||||||||||||
| 38 | } ## end sub set | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 1 | ▶ | sub TO_JSON { return undef } | ||||||||||||||||||||||||||
|
Subroutine
TO_JSON: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 6 | 1; | |||||||||||||||||||||||||||