Class: Arara::DialogButtonComponent
- Inherits:
-
ActionView::Component::Base
- Object
- ActionView::Component::Base
- Arara::DialogButtonComponent
- Includes:
- BaseComponent
- Defined in:
- app/components/arara/dialog_button_component.rb
Instance Attribute Summary collapse
-
#dialog_action ⇒ Object
readonly
Returns the value of attribute dialog_action.
Instance Method Summary collapse
- #default_html_class ⇒ Object
- #html_data ⇒ Object
- #html_options ⇒ Object
-
#initialize(dialog_action:, **kw) ⇒ DialogButtonComponent
constructor
A new instance of DialogButtonComponent.
Methods included from BaseComponent
#default_data_controller, #default_html_tag, #html_class, #html_content, #html_tag, included
Constructor Details
#initialize(dialog_action:, **kw) ⇒ DialogButtonComponent
Returns a new instance of DialogButtonComponent.
8 9 10 11 12 |
# File 'app/components/arara/dialog_button_component.rb', line 8 def initialize(dialog_action:, **kw) super(tag: "button", **kw) @dialog_action = dialog_action end |
Instance Attribute Details
#dialog_action ⇒ Object (readonly)
Returns the value of attribute dialog_action.
6 7 8 |
# File 'app/components/arara/dialog_button_component.rb', line 6 def dialog_action @dialog_action end |
Instance Method Details
#default_html_class ⇒ Object
15 16 17 |
# File 'app/components/arara/dialog_button_component.rb', line 15 def default_html_class "mdc-button mdc-dialog__button" end |
#html_data ⇒ Object
25 26 27 28 29 |
# File 'app/components/arara/dialog_button_component.rb', line 25 def html_data data = super data.merge!('mdc-dialog-action': dialog_action) data end |
#html_options ⇒ Object
19 20 21 22 23 |
# File 'app/components/arara/dialog_button_component.rb', line 19 def opts = super opts.merge!({type: "button"}) opts end |