Class: Discordrb::Webhooks::Modal
- Inherits:
-
Object
- Object
- Discordrb::Webhooks::Modal
- Defined in:
- lib/discordrb/webhooks/modal.rb
Overview
Modal component builder.
Defined Under Namespace
Classes: RowBuilder
Constant Summary collapse
- COMPONENT_TYPES =
A mapping of names to types of components usable in a modal.
{ action_row: 1, text_input: 4 }.freeze
Instance Attribute Summary collapse
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Modal
constructor
A new instance of Modal.
-
#row {|| ... } ⇒ Object
Add a new ActionRow to the view.
Constructor Details
#initialize {|_self| ... } ⇒ Modal
Returns a new instance of Modal.
60 61 62 63 64 |
# File 'lib/discordrb/webhooks/modal.rb', line 60 def initialize @rows = [] yield self if block_given? end |
Instance Attribute Details
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
58 59 60 |
# File 'lib/discordrb/webhooks/modal.rb', line 58 def rows @rows end |
Instance Method Details
#row {|| ... } ⇒ Object
Add a new ActionRow to the view
68 69 70 71 72 73 74 |
# File 'lib/discordrb/webhooks/modal.rb', line 68 def row new_row = RowBuilder.new yield new_row @rows << new_row end |