Class: DiscordRDA::Components::Thumbnail

Inherits:
Base
  • Object
show all
Defined in:
lib/discord_rda/interactions/components.rb

Overview

Thumbnail component (V2)

Instance Attribute Summary

Attributes inherited from Base

#data, #type

Instance Method Summary collapse

Methods inherited from Base

#to_h

Constructor Details

#initialize(media:, description: nil, spoiler: false, id: nil) ⇒ Thumbnail

Returns a new instance of Thumbnail.



320
321
322
323
324
325
326
# File 'lib/discord_rda/interactions/components.rb', line 320

def initialize(media:, description: nil, spoiler: false, id: nil)
  data = { media: media }
  data[:description] = description if description
  data[:spoiler] = spoiler if spoiler
  data[:id] = id if id
  super(:thumbnail, data)
end