File Coverage

blib/lib/Net/API/Telegram/MessageEntity.pm
Criterion Covered Total %
statement 7 12 58.3
branch n/a
condition n/a
subroutine 3 8 37.5
pod 5 5 100.0
total 15 25 60.0


line stmt bran cond sub pod time code
1             # -*- perl -*-
2             ##----------------------------------------------------------------------------
3             ## Telegram API - ~/lib/Net/API/Telegram/MessageEntity.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 2019/11/01
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::MessageEntity;
15             BEGIN
16             {
17 1     1   1034 use strict;
  1         2  
  1         36  
18 1     1   5 use parent qw( Net::API::Telegram::Generic );
  1         2  
  1         5  
19 1     1   210 our( $VERSION ) = '0.1';
20             };
21              
22 0     0 1   sub length { return( shift->_set_get_number( 'length', @_ ) ); }
23              
24 0     0 1   sub offset { return( shift->_set_get_number( 'offset', @_ ) ); }
25              
26 0     0 1   sub type { return( shift->_set_get_scalar( 'type', @_ ) ); }
27              
28 0     0 1   sub url { return( shift->_set_get_scalar( 'url', @_ ) ); }
29              
30 0     0 1   sub user { return( shift->_set_get_object( 'user', 'Net::API::Telegram::User', @_ ) ); }
31              
32             1;
33              
34             __END__
35              
36             =encoding utf-8
37              
38             =head1 NAME
39              
40             Net::API::Telegram::MessageEntity - One special entity in a text message
41              
42             =head1 SYNOPSIS
43              
44             my $msg = Net::API::Telegram::MessageEntity->new( %data ) ||
45             die( Net::API::Telegram::MessageEntity->error, "\n" );
46              
47             =head1 DESCRIPTION
48              
49             L<Net::API::Telegram::MessageEntity> is a Telegram Message Object as defined here L<https://core.telegram.org/bots/api#messageentity>
50              
51             This module has been automatically generated from Telegram API documentation by the script scripts/telegram-doc2perl-methods.pl.
52              
53             =head1 METHODS
54              
55             =over 4
56              
57             =item B<new>( {INIT HASH REF}, %PARAMETERS )
58              
59             B<new>() will create a new object for the package, pass any argument it might receive
60             to the special standard routine B<init> that I<must> exist.
61             Then it returns what returns B<init>().
62              
63             The valid parameters are as follow. Methods available here are also parameters to the B<new> method.
64              
65             =over 8
66              
67             =item * I<verbose>
68              
69             =item * I<debug>
70              
71             =back
72              
73             =item B<length>( Integer )
74              
75             Length of the entity in UTF-16 code units
76              
77             =item B<offset>( Integer )
78              
79             Offset in UTF-16 code units to the start of the entity
80              
81             =item B<type>( String )
82              
83             Type of the entity. Can be mention (@username), hashtag, cashtag, bot_command, url, email, phone_number, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames)
84              
85             =item B<url>( String )
86              
87             Optional. For I<text_link> only, url that will be opened after user taps on the text
88              
89             =item B<user>( L<Net::API::Telegram::User> )
90              
91             Optional. For I<text_mention> only, the mentioned user
92              
93             =back
94              
95             =head1 COPYRIGHT
96              
97             Copyright (c) 2000-2019 DEGUEST Pte. Ltd.
98              
99             =head1 AUTHOR
100              
101             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
102              
103             =head1 SEE ALSO
104              
105             L<Net::API::Telegram>
106              
107             =head1 COPYRIGHT & LICENSE
108              
109             Copyright (c) 2018-2019 DEGUEST Pte. Ltd.
110              
111             You can use, copy, modify and redistribute this package and associated
112             files under the same terms as Perl itself.
113              
114             =cut
115