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 the components contained within this action row.

Returns:

  • (Array<Button>)

    the components contained within this action row.



56
57
58
# File 'lib/discordrb/data/component.rb', line 56

def components
  @components
end

#idInteger (readonly)

Returns the numeric identifier of the action row.

Returns:

  • (Integer)

    the numeric identifier of the action row.



53
54
55
# File 'lib/discordrb/data/component.rb', line 53

def id
  @id
end

Instance Method Details

#buttonsArray<Button>

Get all the buttons in this action row.

Returns:

  • (Array<Button>)

    All of the buttons in this action row.



73
74
75
# File 'lib/discordrb/data/component.rb', line 73

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

#each(&block) ⇒ Array, Enumerator

Iterate over each component in the row.

Returns:

  • (Array, Enumerator)


67
68
69
# File 'lib/discordrb/data/component.rb', line 67

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

#text_inputsArray<TextInput>

Get all the text inputs in this action row.

Returns:

  • (Array<TextInput>)

    All of the text inputs in this action row.



79
80
81
# File 'lib/discordrb/data/component.rb', line 79

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