Class: MTProto::TL::MessageEntity
- Inherits:
-
Struct
- Object
- Struct
- MTProto::TL::MessageEntity
- Defined in:
- lib/mtproto/tl/message_entity.rb
Overview
A single MessageEntity — one formatting span over a message's text. offset
and length are in UTF-16 code units (Telegram's unit, what the wire
carries), NOT bytes or codepoints. type is a symbol; any type-specific
payload rides in the matching field:
:text_url -> url
:pre -> language
:mention_name -> user_id (+ access_hash, needed to SEND a text-mention)
:custom_emoji -> document_id
:blockquote -> collapsed (expandable quote)
Instance Attribute Summary collapse
-
#access_hash ⇒ Object
Returns the value of attribute access_hash.
-
#collapsed ⇒ Object
Returns the value of attribute collapsed.
-
#document_id ⇒ Object
Returns the value of attribute document_id.
-
#language ⇒ Object
Returns the value of attribute language.
-
#length ⇒ Object
Returns the value of attribute length.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#type ⇒ Object
Returns the value of attribute type.
-
#url ⇒ Object
Returns the value of attribute url.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Instance Method Summary collapse
Instance Attribute Details
#access_hash ⇒ Object
Returns the value of attribute access_hash
16 17 18 |
# File 'lib/mtproto/tl/message_entity.rb', line 16 def access_hash @access_hash end |
#collapsed ⇒ Object
Returns the value of attribute collapsed
16 17 18 |
# File 'lib/mtproto/tl/message_entity.rb', line 16 def collapsed @collapsed end |
#document_id ⇒ Object
Returns the value of attribute document_id
16 17 18 |
# File 'lib/mtproto/tl/message_entity.rb', line 16 def document_id @document_id end |
#language ⇒ Object
Returns the value of attribute language
16 17 18 |
# File 'lib/mtproto/tl/message_entity.rb', line 16 def language @language end |
#length ⇒ Object
Returns the value of attribute length
16 17 18 |
# File 'lib/mtproto/tl/message_entity.rb', line 16 def length @length end |
#offset ⇒ Object
Returns the value of attribute offset
16 17 18 |
# File 'lib/mtproto/tl/message_entity.rb', line 16 def offset @offset end |
#type ⇒ Object
Returns the value of attribute type
16 17 18 |
# File 'lib/mtproto/tl/message_entity.rb', line 16 def type @type end |
#url ⇒ Object
Returns the value of attribute url
16 17 18 |
# File 'lib/mtproto/tl/message_entity.rb', line 16 def url @url end |
#user_id ⇒ Object
Returns the value of attribute user_id
16 17 18 |
# File 'lib/mtproto/tl/message_entity.rb', line 16 def user_id @user_id end |
Instance Method Details
#to_h ⇒ Object
21 22 23 |
# File 'lib/mtproto/tl/message_entity.rb', line 21 def to_h super.compact end |