| 1 | package LINE::Bot::API::Event::Base; | ||||||||||
| 2 | 47 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 47 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 47 | ▶ | use Carp 'croak'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | sub new { | ||||||||||
| 8 | 17 | ▶ | my($class, %args) = @_; | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 9 | 17 | bless { %args }, $class; | |||||||||
| 10 | } | ||||||||||
| 11 | |||||||||||
| 12 | # Accessors for Event-level properties. https://developers.line.biz/en/reference/messaging-api/#common-properties | ||||||||||
| 13 | 1 | ▶ | sub type { $_[0]->{type} } | ||||||||
|
Subroutine
type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 14 | 16 | ▶ | sub mode { $_[0]->{mode} } | ||||||||
|
Subroutine
mode: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 15 | 2 | ▶ | sub timestamp { $_[0]->{timestamp} } | ||||||||
|
Subroutine
timestamp: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 16 | |||||||||||
| 17 | # Unfollow and Leave events don't have this | ||||||||||
| 18 | 17 | ▶ | sub reply_token { $_[0]->{replyToken} } | ||||||||
|
Subroutine
reply_token: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 19 | |||||||||||
| 20 | # type | ||||||||||
| 21 | 0 | ▶ | sub is_message_event { 0 } | ||||||||
|
Subroutine
is_message_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 22 | 0 | ▶ | sub is_follow_event { 0 } | ||||||||
|
Subroutine
is_follow_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 23 | 0 | ▶ | sub is_unfollow_event { 0 } | ||||||||
|
Subroutine
is_unfollow_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 24 | 0 | ▶ | sub is_join_event { 0 } | ||||||||
|
Subroutine
is_join_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 25 | 0 | ▶ | sub is_leave_event { 0 } | ||||||||
|
Subroutine
is_leave_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 26 | 0 | ▶ | sub is_member_join_event { 0 } | ||||||||
|
Subroutine
is_member_join_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 27 | 0 | ▶ | sub is_member_leave_event { 0 } | ||||||||
|
Subroutine
is_member_leave_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 28 | 0 | ▶ | sub is_postback_event { 0 } | ||||||||
|
Subroutine
is_postback_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 29 | 0 | ▶ | sub is_beacon_detection_event { 0 } | ||||||||
|
Subroutine
is_beacon_detection_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 30 | 0 | ▶ | sub is_device_link_event { 0 } | ||||||||
|
Subroutine
is_device_link_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 31 | 0 | ▶ | sub is_device_unlink_event { 0 } | ||||||||
|
Subroutine
is_device_unlink_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 32 | 0 | ▶ | sub is_account_link_event { 0 } | ||||||||
|
Subroutine
is_account_link_event: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 33 | |||||||||||
| 34 | # source field | ||||||||||
| 35 | 1 | ▶ | sub is_user_event { $_[0]->{source}{type} eq 'user' } | ||||||||
|
Subroutine
is_user_event: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 36 | 4 | ▶ | sub is_group_event { $_[0]->{source}{type} eq 'group' } | ||||||||
|
Subroutine
is_group_event: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 37 | 4 | ▶ | sub is_room_event { $_[0]->{source}{type} eq 'room' } | ||||||||
|
Subroutine
is_room_event: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 38 | |||||||||||
| 39 | 3 | ▶ | sub user_id { $_[0]->{source}{userId} } | ||||||||
|
Subroutine
user_id: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 40 | |||||||||||
| 41 | sub group_id { | ||||||||||
| 42 | 2 | ▶ | my $self = shift; | ||||||||
|
Subroutine
group_id: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 43 | 2 | ▶ | croak 'This event source is not a group type.' unless $self->is_group_event; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 44 | 2 | $self->{source}{groupId}; | |||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | sub room_id { | ||||||||||
| 48 | 2 | ▶ | my $self = shift; | ||||||||
|
Subroutine
room_id: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||
| 49 | 2 | ▶ | croak 'This event source is not a room type.' unless $self->is_room_event; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | 2 | $self->{source}{roomId}; | |||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 47 | 1; | |||||||||