| 1 | package LINE::Bot::API::Event::Things; | ||||||||||
| 2 | 53 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 53 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 53 | ▶ | use parent 'LINE::Bot::API::Event::Base'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 53 | ▶ | use Carp 'carp'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 53 | our @CARP_NOT = qw( LINE::Bot::API::Event::Things LINE::Bot::API::Event LINE::Bot::API); | |||||||||
| 8 | |||||||||||
| 9 | 53 | my %TYPE2CLASS = ( | |||||||||
| 10 | link => 'LINE::Bot::API::Event::Things::Link', | ||||||||||
| 11 | unlink => 'LINE::Bot::API::Event::Things::Unlink', | ||||||||||
| 12 | ); | ||||||||||
| 13 | |||||||||||
| 14 | 4 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||
| 15 | 4 | my($class, %args) = @_; | |||||||||
| 16 | |||||||||||
| 17 | 4 | my $type = $args{things}{type}; | |||||||||
| 18 | 4 | my $things_class = $TYPE2CLASS{$type}; | |||||||||
| 19 | 4 | ▶ | unless ($things_class) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 0 | carp 'Unsupported Things type: ' . $type; | |||||||||
| 21 | 0 | $things_class = $class; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 4 | bless { %args }, $things_class; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 2 | ▶ | sub is_things_event { 1 } | ||||||||
|
Subroutine
is_things_event: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 28 | |||||||||||
| 29 | 2 | ▶ | sub things_device_id { $_[0]->{things}{deviceId} } | ||||||||
|
Subroutine
things_device_id: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 30 | 2 | ▶ | sub things_type { $_[0]->{things}{type} } | ||||||||
|
Subroutine
things_type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 31 | |||||||||||
| 32 | 0 | ▶ | sub is_device_link { 0 } | ||||||||
|
Subroutine
is_device_link: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 33 | 0 | ▶ | sub is_device_unlink { 0 } | ||||||||
|
Subroutine
is_device_unlink: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 34 | |||||||||||
| 35 | 53 | package LINE::Bot::API::Event::Things::Link { | |||||||||
| 36 | 53 | ▶ | use parent 'LINE::Bot::API::Event::Things'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 37 | |||||||||||
| 38 | 1 | ▶ | sub is_device_link { 1 } | ||||||||
|
Subroutine
is_device_link: called CC=1 SCAR=0.0
| |||||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 53 | package LINE::Bot::API::Event::Things::Unlink { | |||||||||
| 42 | 53 | ▶ | use parent 'LINE::Bot::API::Event::Things'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 43 | |||||||||||
| 44 | 1 | ▶ | sub is_device_unlink { 1 } | ||||||||
|
Subroutine
is_device_unlink: called CC=1 SCAR=0.0
| |||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 53 | 1; | |||||||||