Class: Message
- Inherits:
-
Object
- Object
- Message
- Defined in:
- lib/telegramObjects.rb
Overview
Object describing a Message
Instance Attribute Summary collapse
-
#audio ⇒ Object
Returns the value of attribute audio.
-
#chat ⇒ Object
Returns the value of attribute chat.
-
#contact ⇒ Object
Returns the value of attribute contact.
-
#date ⇒ Object
Returns the value of attribute date.
-
#delete_chat_photo ⇒ Object
Returns the value of attribute delete_chat_photo.
-
#document ⇒ Object
Returns the value of attribute document.
-
#forward_date ⇒ Object
Returns the value of attribute forward_date.
-
#forward_from ⇒ Object
Returns the value of attribute forward_from.
-
#from ⇒ Object
Returns the value of attribute from.
-
#group_chat_create ⇒ Object
Returns the value of attribute group_chat_create.
-
#left_chat_participant ⇒ Object
Returns the value of attribute left_chat_participant.
-
#location ⇒ Object
Returns the value of attribute location.
-
#message_id ⇒ Object
Returns the value of attribute message_id.
-
#new_chat_participant ⇒ Object
Returns the value of attribute new_chat_participant.
-
#new_chat_photo ⇒ Object
Returns the value of attribute new_chat_photo.
-
#new_chat_title ⇒ Object
Returns the value of attribute new_chat_title.
-
#photo ⇒ Object
Returns the value of attribute photo.
-
#reply_to_message ⇒ Object
Returns the value of attribute reply_to_message.
-
#sticker ⇒ Object
Returns the value of attribute sticker.
-
#text ⇒ Object
Returns the value of attribute text.
-
#video ⇒ Object
Returns the value of attribute video.
Instance Method Summary collapse
-
#initialize(json) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(json) ⇒ Message
Returns a new instance of Message.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/telegramObjects.rb', line 55 def initialize json return if !json @message_id = json["message_id"] @from = User.new json["from"] @date = json["date"] @chat = !json["chat"] ? nil : (json["chat"].has_key?("title") ? GroupChat.new(json["chat"]) : User.new(json["chat"])) @forward_from = User.new json["forward_from"] @forward_date = json["forward_date"] @reply_to_message = Message.new json["reply_to_message"] @text = json["text"] @audio = Audio.new json["audio"] @document = Document.new json["document"] @photo = ArrayOf.new(json["photo"], PhotoSize).to_a @sticker = Sticker.new json["sticker"] @video = Video.new json["video"] @contact = Contact.new json["contact"] @location = Location.new json["location"] @new_chat_participant = User.new json["new_chat_participant"] @left_chat_participant = User.new json["left_chat_participant"] @new_chat_title = json["new_chat_title"] @new_chat_photo = ArrayOf.new(json["new_chat_photo"],PhotoSize).to_a @delete_chat_photo = json["delete_chat_photo"] @group_chat_create = json["group_chat_create"] end |
Instance Attribute Details
#audio ⇒ Object
Returns the value of attribute audio.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def audio @audio end |
#chat ⇒ Object
Returns the value of attribute chat.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def chat @chat end |
#contact ⇒ Object
Returns the value of attribute contact.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def contact @contact end |
#date ⇒ Object
Returns the value of attribute date.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def date @date end |
#delete_chat_photo ⇒ Object
Returns the value of attribute delete_chat_photo.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def delete_chat_photo @delete_chat_photo end |
#document ⇒ Object
Returns the value of attribute document.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def document @document end |
#forward_date ⇒ Object
Returns the value of attribute forward_date.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def forward_date @forward_date end |
#forward_from ⇒ Object
Returns the value of attribute forward_from.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def forward_from @forward_from end |
#from ⇒ Object
Returns the value of attribute from.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def from @from end |
#group_chat_create ⇒ Object
Returns the value of attribute group_chat_create.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def group_chat_create @group_chat_create end |
#left_chat_participant ⇒ Object
Returns the value of attribute left_chat_participant.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def left_chat_participant @left_chat_participant end |
#location ⇒ Object
Returns the value of attribute location.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def location @location end |
#message_id ⇒ Object
Returns the value of attribute message_id.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def @message_id end |
#new_chat_participant ⇒ Object
Returns the value of attribute new_chat_participant.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def new_chat_participant @new_chat_participant end |
#new_chat_photo ⇒ Object
Returns the value of attribute new_chat_photo.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def new_chat_photo @new_chat_photo end |
#new_chat_title ⇒ Object
Returns the value of attribute new_chat_title.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def new_chat_title @new_chat_title end |
#photo ⇒ Object
Returns the value of attribute photo.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def photo @photo end |
#reply_to_message ⇒ Object
Returns the value of attribute reply_to_message.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def @reply_to_message end |
#sticker ⇒ Object
Returns the value of attribute sticker.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def sticker @sticker end |
#text ⇒ Object
Returns the value of attribute text.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def text @text end |
#video ⇒ Object
Returns the value of attribute video.
50 51 52 |
# File 'lib/telegramObjects.rb', line 50 def video @video end |