Class: Discordrb::Components::ActionRow

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/discordrb/data/component.rb

Overview

Represents a row of components

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#componentsArray<Button> (readonly)

Returns:



29
30
31
# File 'lib/discordrb/data/component.rb', line 29

def components
  @components
end

Instance Method Details

#buttonsArray<Button>

Get all buttons in this row

Returns:



44
45
46
# File 'lib/discordrb/data/component.rb', line 44

def buttons
  select { |component| component.is_a? Button }
end

#each(&block) ⇒ Object

Iterate over each component in the row.



38
39
40
# File 'lib/discordrb/data/component.rb', line 38

def each(&block)
  @components.each(&block)
end

#text_inputsArray<Button>

Get all buttons in this row

Returns:



50
51
52
# File 'lib/discordrb/data/component.rb', line 50

def text_inputs
  select { |component| component.is_a? TextInput }
end