Class: Discordrb::Components::Container
- Inherits:
-
Object
- Object
- Discordrb::Components::Container
- Defined in:
- lib/discordrb/data/component.rb
Overview
A collection of components in an embed-like format.
Instance Attribute Summary collapse
-
#color ⇒ ColourRGB?
(also: #colour)
readonly
The accent colour of the container.
-
#components ⇒ Array<Component>
readonly
The child components of the container.
-
#id ⇒ Integer
readonly
The numeric identifier of the container.
-
#spoiler ⇒ true, false
(also: #spoiler?)
readonly
Whether or not the container should be blurred out.
Instance Method Summary collapse
-
#buttons ⇒ Array<Button>
Get the buttons contained within the container.
Instance Attribute Details
#color ⇒ ColourRGB? (readonly) Also known as: colour
Returns the accent colour of the container.
382 383 384 |
# File 'lib/discordrb/data/component.rb', line 382 def color @color end |
#components ⇒ Array<Component> (readonly)
Returns the child components of the container.
391 392 393 |
# File 'lib/discordrb/data/component.rb', line 391 def components @components end |
#id ⇒ Integer (readonly)
Returns the numeric identifier of the container.
379 380 381 |
# File 'lib/discordrb/data/component.rb', line 379 def id @id end |
#spoiler ⇒ true, false (readonly) Also known as: spoiler?
Returns whether or not the container should be blurred out.
387 388 389 |
# File 'lib/discordrb/data/component.rb', line 387 def spoiler @spoiler end |
Instance Method Details
#buttons ⇒ Array<Button>
Get the buttons contained within the container.
404 405 406 407 408 409 410 411 412 413 |
# File 'lib/discordrb/data/component.rb', line 404 def @components.flat_map do |component| case component when ActionRow component. when Section component.accessory if component.accessory.is_a?(Button) end end.compact end |