Class: GrubY::PollOption

Inherits:
BaseObject show all
Defined in:
lib/gruubY/types/extra.rb

Instance Attribute Summary

Attributes inherited from BaseObject

#api, #client

Instance Method Summary collapse

Methods inherited from BaseObject

#[], #dig, field_names, fields, #method_missing, #respond_to_missing?, #to_h

Constructor Details

#initialize(data) ⇒ PollOption

Returns a new instance of PollOption.



208
209
210
211
212
213
# File 'lib/gruubY/types/extra.rb', line 208

def initialize(data)
  super(data)
  @text_entities = Array(@text_entities).map { |e| MessageEntity.new(e) }
  @added_by_user = User.new(@added_by_user) if @added_by_user.is_a?(Hash)
  @added_by_chat = Chat.new(@added_by_chat) if @added_by_chat.is_a?(Hash)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class GrubY::BaseObject