| 1 | 8 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 8 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | package WebService::ChatWork::Message; | ||||||||||||||||||||||||||||
| 4 | 8 | ▶ | use Carp ( ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 8 | ▶ | use String::CamelCase qw( camelize ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 8 | ▶ | use Class::Load qw( try_load_class ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 8 | ▶ | use WebService::ChatWork::Message::Tag; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | # ABSTRACT: A Tag Builder of ChatWork | ||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 8 | our $VERSION = '0.02'; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 13 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | 13 | my $class = shift; | |||||||||||||||||||||||||||
| 15 | 13 | my $tag = shift; | |||||||||||||||||||||||||||
| 16 | 13 | my @params = @_; | |||||||||||||||||||||||||||
| 17 | 13 | my $package = "$class\::Tag"; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 13 | ▶ | if ( !@params && $tag ne "hr" ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not @params and $tag ne "hr"
MC/DC100%2/2
not @params and $tag ne "hr"
not @params
$tag ne "hr"
Truth table100%3/3
not(A) and B
A= not @paramsB= $tag ne "hr"
| |||||||||||||||||||||||||||||
| 20 | 1 | @params = ( $tag ); | |||||||||||||||||||||||||||
| 21 | 1 | $tag = q{}; | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | else { | ||||||||||||||||||||||||||||
| 24 | 12 | $package = sprintf "$class\::Tag::%s", camelize( $tag ); | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 13 | ▶ | try_load_class( $package ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | or die "Could not load $package."; | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 13 | return $package->new( @params ); | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 8 | 1; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||||||||||