Class: Telegem::Types::Update

Inherits:
BaseType
  • Object
show all
Defined in:
lib/api/types.rb

Instance Attribute Summary collapse

Attributes inherited from BaseType

#_raw_data

Instance Method Summary collapse

Methods inherited from BaseType

#method_missing, #respond_to_missing?

Constructor Details

#initialize(data) ⇒ Update

Returns a new instance of Update.



181
182
183
184
185
186
187
# File 'lib/api/types.rb', line 181

def initialize(data)
  super(data)
  
  @update_id = data['update_id']
  @message = Message.new(data['message']) if data['message']
  @callback_query = CallbackQuery.new(data['callback_query']) if data['callback_query']
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Telegem::Types::BaseType

Instance Attribute Details

#callback_queryObject (readonly)

Returns the value of attribute callback_query.



179
180
181
# File 'lib/api/types.rb', line 179

def callback_query
  @callback_query
end

#messageObject (readonly)

Returns the value of attribute message.



179
180
181
# File 'lib/api/types.rb', line 179

def message
  @message
end

#update_idObject (readonly)

Returns the value of attribute update_id.



179
180
181
# File 'lib/api/types.rb', line 179

def update_id
  @update_id
end