Class: Rubycord::Components::ActionRow

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

Overview

Represents a row of components

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#componentsArray<Button> (readonly)

Returns:



27
28
29
# File 'lib/rubycord/data/component.rb', line 27

def components
  @components
end

Instance Method Details

#buttonsArray<Button>

Get all buttons in this row

Returns:



42
43
44
# File 'lib/rubycord/data/component.rb', line 42

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

#eachObject

Iterate over each component in the row.



36
37
38
# File 'lib/rubycord/data/component.rb', line 36

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

#text_inputsArray<Button>

Get all buttons in this row

Returns:



48
49
50
# File 'lib/rubycord/data/component.rb', line 48

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