Class: DiscordRDA::Components::Base
- Inherits:
-
Object
- Object
- DiscordRDA::Components::Base
- Defined in:
- lib/discord_rda/interactions/components.rb
Overview
Base component class
Direct Known Subclasses
ActionRow, Button, Container, FileComponent, MediaGallery, Section, SelectMenu, Separator, TextDisplay, TextInput, Thumbnail
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, data = {}) ⇒ Base
constructor
A new instance of Base.
-
#to_h ⇒ Hash
Convert to hash for API.
Constructor Details
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
45 46 47 |
# File 'lib/discord_rda/interactions/components.rb', line 45 def data @data end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
45 46 47 |
# File 'lib/discord_rda/interactions/components.rb', line 45 def type @type end |
Instance Method Details
#to_h ⇒ Hash
Convert to hash for API
54 55 56 |
# File 'lib/discord_rda/interactions/components.rb', line 54 def to_h @data end |