File Coverage

blib/lib/Net/API/Telegram/User.pm
Criterion Covered Total %
statement 7 14 50.0
branch n/a
condition n/a
subroutine 3 10 30.0
pod 6 6 100.0
total 16 30 53.3


line stmt bran cond sub pod time code
1             # -*- perl -*-
2             ##----------------------------------------------------------------------------
3             ## Net/API/Telegram/User.pm
4             ## Version 0.1
5             ## Copyright(c) 2019 Jacques Deguest
6             ## Author: Jacques Deguest <jack@deguest.jp>
7             ## Created 2019/05/29
8             ## Modified 2020/05/20
9             ## All rights reserved.
10             ##
11             ## This program is free software; you can redistribute it and/or modify it
12             ## under the same terms as Perl itself.
13             ##----------------------------------------------------------------------------
14             package Net::API::Telegram::User;
15             BEGIN
16             {
17 1     1   1270 use strict;
  1         2  
  1         30  
18 1     1   4 use parent qw( Net::API::Telegram::Generic );
  1         2  
  1         4  
19 1     1   208 our( $VERSION ) = '0.1';
20             };
21              
22 0     0 1   sub first_name { return( shift->_set_get_scalar( 'first_name', @_ ) ); }
23              
24 0     0 1   sub id { return( shift->_set_get_number( 'id', @_ ) ); }
25              
26 0     0 1   sub is_bot { return( shift->_set_get_scalar( 'is_bot', @_ ) ); }
27              
28 0     0 1   sub language_code { return( shift->_set_get_scalar( 'language_code', @_ ) ); }
29              
30 0     0 1   sub last_name { return( shift->_set_get_scalar( 'last_name', @_ ) ); }
31              
32 0     0 1   sub username { return( shift->_set_get_scalar( 'username', @_ ) ); }
33              
34 0     0     sub _is_boolean { return( grep( /^$_[1]$/, qw( is_bot ) ) ); }
35              
36             1;
37              
38             __END__
39              
40             =encoding utf-8
41              
42             =head1 NAME
43              
44             Net::API::Telegram::User - A Telegram user or bot
45              
46             =head1 SYNOPSIS
47              
48             my $msg = Net::API::Telegram::User->new( %data ) ||
49             die( Net::API::Telegram::User->error, "\n" );
50              
51             =head1 DESCRIPTION
52              
53             L<Net::API::Telegram::User> is a Telegram Message Object as defined here L<https://core.telegram.org/bots/api#user>
54              
55             This module has been automatically generated from Telegram API documentation by the script scripts/telegram-doc2perl-methods.pl.
56              
57             =head1 METHODS
58              
59             =over 4
60              
61             =item B<new>( {INIT HASH REF}, %PARAMETERS )
62              
63             B<new>() will create a new object for the package, pass any argument it might receive
64             to the special standard routine B<init> that I<must> exist.
65             Then it returns what returns B<init>().
66              
67             The valid parameters are as follow. Methods available here are also parameters to the B<new> method.
68              
69             =over 8
70              
71             =item * I<verbose>
72              
73             =item * I<debug>
74              
75             =back
76              
77             =item B<first_name>( String )
78              
79             User‘s or bot’s first name
80              
81             =item B<id>( Integer )
82              
83             Unique identifier for this user or bot
84              
85             =item B<is_bot>( Boolean )
86              
87             True, if this user is a bot
88              
89             =item B<language_code>( String )
90              
91             Optional. IETF language tag of the user's language
92              
93             =item B<last_name>( String )
94              
95             Optional. User‘s or bot’s last name
96              
97             =item B<username>( String )
98              
99             Optional. User‘s or bot’s username
100              
101             =back
102              
103             =head1 COPYRIGHT
104              
105             Copyright (c) 2000-2019 DEGUEST Pte. Ltd.
106              
107             =head1 AUTHOR
108              
109             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
110              
111             =head1 SEE ALSO
112              
113             L<Net::API::Telegram>
114              
115             =head1 COPYRIGHT & LICENSE
116              
117             Copyright (c) 2018-2019 DEGUEST Pte. Ltd.
118              
119             You can use, copy, modify and redistribute this package and associated
120             files under the same terms as Perl itself.
121              
122             =cut
123