Class: Update
- Inherits:
-
Object
- Object
- Update
- Defined in:
- lib/telegram/update.rb
Overview
Is a representation of Telegrams Update object
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(update_id:, message: nil, inline_query: nil, chosen_inline_result: nil) ⇒ Update
constructor
A new instance of Update.
Constructor Details
#initialize(update_id:, message: nil, inline_query: nil, chosen_inline_result: nil) ⇒ Update
Returns a new instance of Update.
15 16 17 18 19 20 |
# File 'lib/telegram/update.rb', line 15 def initialize(update_id:, message: nil, inline_query: nil, chosen_inline_result: nil) @update_id = update_id = @inline_query = inline_query @chosen_inline_result = chosen_inline_result end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/telegram/update.rb', line 5 def end |
Class Method Details
.from_hash(update) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/telegram/update.rb', line 7 def self.from_hash(update) return nil unless update.is_a? Hash = Message.from_hash update['message'] Update.new(update_id: update['update_id'], message: ) end |