line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Things; |
2
|
47
|
|
|
47
|
|
318
|
use strict; |
|
47
|
|
|
|
|
104
|
|
|
47
|
|
|
|
|
1337
|
|
3
|
47
|
|
|
47
|
|
228
|
use warnings; |
|
47
|
|
|
|
|
96
|
|
|
47
|
|
|
|
|
1146
|
|
4
|
47
|
|
|
47
|
|
218
|
use parent 'LINE::Bot::API::Event::Base'; |
|
47
|
|
|
|
|
117
|
|
|
47
|
|
|
|
|
238
|
|
5
|
|
|
|
|
|
|
|
6
|
47
|
|
|
47
|
|
2986
|
use Carp 'carp'; |
|
47
|
|
|
|
|
99
|
|
|
47
|
|
|
|
|
13069
|
|
7
|
|
|
|
|
|
|
our @CARP_NOT = qw( LINE::Bot::API::Event::Things LINE::Bot::API::Event LINE::Bot::API); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my %TYPE2CLASS = ( |
10
|
|
|
|
|
|
|
link => 'LINE::Bot::API::Event::Things::Link', |
11
|
|
|
|
|
|
|
unlink => 'LINE::Bot::API::Event::Things::Unlink', |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
4
|
|
|
4
|
0
|
14
|
my($class, %args) = @_; |
16
|
|
|
|
|
|
|
|
17
|
4
|
|
|
|
|
9
|
my $type = $args{things}{type}; |
18
|
4
|
|
|
|
|
10
|
my $things_class = $TYPE2CLASS{$type}; |
19
|
4
|
50
|
|
|
|
14
|
unless ($things_class) { |
20
|
0
|
|
|
|
|
0
|
carp 'Unsupported Things type: ' . $type; |
21
|
0
|
|
|
|
|
0
|
$things_class = $class; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
4
|
|
|
|
|
26
|
bless { %args }, $things_class; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
2
|
0
|
9641
|
sub is_things_event { 1 } |
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
2
|
0
|
27
|
sub things_device_id { $_[0]->{things}{deviceId} } |
30
|
2
|
|
|
2
|
0
|
11
|
sub things_type { $_[0]->{things}{type} } |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
0
|
0
|
0
|
sub is_device_link { 0 } |
33
|
0
|
|
|
0
|
0
|
0
|
sub is_device_unlink { 0 } |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Things::Link { |
36
|
47
|
|
|
47
|
|
379
|
use parent 'LINE::Bot::API::Event::Things'; |
|
47
|
|
|
|
|
126
|
|
|
47
|
|
|
|
|
297
|
|
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
1
|
|
5
|
sub is_device_link { 1 } |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Things::Unlink { |
42
|
47
|
|
|
47
|
|
4573
|
use parent 'LINE::Bot::API::Event::Things'; |
|
47
|
|
|
|
|
143
|
|
|
47
|
|
|
|
|
263
|
|
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
1
|
|
5
|
sub is_device_unlink { 1 } |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |