Class: GrubY::Animation

Inherits:
BaseObject show all
Defined in:
lib/gruubY/types/extra.rb,
lib/gruubY/types/bound_entities.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) ⇒ Animation

Returns a new instance of Animation.



102
103
104
105
# File 'lib/gruubY/types/extra.rb', line 102

def initialize(data)
  super(data)
  @thumbnail = PhotoSize.new(@thumbnail) if @thumbnail.is_a?(Hash)
end

Dynamic Method Handling

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

Instance Method Details

#add_to_gifsObject



240
241
242
243
# File 'lib/gruubY/types/bound_entities.rb', line 240

def add_to_gifs
  file_id = self["file_id"] || dig("file_id")
  call_raw_api("addToGifs", { file_id: file_id })
end