| 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::Tag; | ||||||||||
| 4 | 8 | ▶ | use overload q{""} => \&as_string; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 8 | ▶ | use constant PRIMARY => "message"; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 8 | ▶ | use Mouse; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 8 | has message => ( is => "ro", isa => "Str" ); | |||||||||
| 9 | |||||||||||
| 10 | 5 | ▶ | sub new_with_primary { | ||||||||
|
Subroutine
new_with_primary: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 11 | 5 | my $class = shift; | |||||||||
| 12 | 5 | my $self = bless { $class->PRIMARY => shift }, $class; | |||||||||
| 13 | 5 | return $self; | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 7 | ▶ | sub new_with_attributes { | ||||||||
|
Subroutine
new_with_attributes: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 17 | 7 | my $class = shift; | |||||||||
| 18 | 7 | return bless { @_ }, $class; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 12 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 22 | 12 | my $class = shift; | |||||||||
| 23 | 12 | my @args = @_; | |||||||||
| 24 | |||||||||||
| 25 | 12 | ▶ | return $class->new_with_primary( @args ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | if @args == 1; | ||||||||||
| 27 | |||||||||||
| 28 | 7 | return $class->new_with_attributes( @args ); | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 1 | ▶ | sub as_string { | ||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 32 | 1 | my $self = shift; | |||||||||
| 33 | 1 | my $name = $self->PRIMARY; | |||||||||
| 34 | 1 | return $self->$name; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 8 | 1; | |||||||||