File Coverage

blib/lib/Telegram/Bot/Object/Chat.pm
Criterion Covered Total %
statement 10 12 83.3
branch n/a
condition n/a
subroutine 4 6 66.6
pod 2 3 66.6
total 16 21 76.1


line stmt bran cond sub pod time code
1             package Telegram::Bot::Object::Chat;
2             $Telegram::Bot::Object::Chat::VERSION = '0.024';
3             # ABSTRACT: The base class for Telegram 'Chat' type objects
4              
5              
6 5     5   34 use Mojo::Base 'Telegram::Bot::Object::Base';
  5         10  
  5         26  
7 5     5   2939 use Telegram::Bot::Object::ChatPhoto;
  5         17  
  5         46  
8 5     5   241 use Telegram::Bot::Object::Message;
  5         11  
  5         40  
9              
10             has 'id';
11             has 'type';
12             has 'title';
13             has 'username';
14             has 'first_name';
15             has 'last_name';
16             has 'all_members_are_administrators';
17             has 'photo'; #ChatPhoto
18             has 'description';
19             has 'invite_link';
20             has 'pinned_message'; #Message
21             has 'sticker_set_name';
22             has 'can_set_sticker_set';
23              
24             sub fields {
25             return {
26 12     12 0 74 'scalar' => [qw/id type title username first_name
27             last_name all_members_are_administrators
28             description invite_link sticker_set_name
29             can_set_sticker_set/],
30             'Telegram::Bot::Object::ChatPhoto' => [qw/photo/],
31             'Telegram::Bot::Object::Message' => [qw/pinned_message/],
32             };
33             }
34              
35              
36             sub is_user {
37 0     0 1   shift->id > 0;
38             }
39              
40              
41             sub is_group {
42 0     0 1   shift->id < 0;
43             }
44              
45             1;
46              
47             __END__