Class: Rubycord::Webhooks::Modal
- Inherits:
-
Object
- Object
- Rubycord::Webhooks::Modal
- Defined in:
- lib/rubycord/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.
58 59 60 61 62 |
# File 'lib/rubycord/webhooks/modal.rb', line 58 def initialize @rows = [] yield self if block_given? end |
Instance Attribute Details
#rows ⇒ Object (readonly)
Returns the value of attribute rows.
56 57 58 |
# File 'lib/rubycord/webhooks/modal.rb', line 56 def rows @rows end |
Instance Method Details
#row {|| ... } ⇒ Object
Add a new ActionRow to the view
66 67 68 69 70 71 72 |
# File 'lib/rubycord/webhooks/modal.rb', line 66 def row new_row = RowBuilder.new yield new_row @rows << new_row end |