Class: Material::ButtonComponent
- Inherits:
-
ApplicationComponent
- Object
- ApplicationComponent
- Material::ButtonComponent
- Defined in:
- app/components/material/button_component.rb
Instance Attribute Summary collapse
-
#button_type ⇒ Object
readonly
Returns the value of attribute button_type.
-
#disabled ⇒ Object
readonly
Returns the value of attribute disabled.
Instance Method Summary collapse
- #container_classes ⇒ Object
- #content_classes ⇒ Object
-
#initialize(name = "", html_options = {}, disabled: false, button_type: :filled) ⇒ ButtonComponent
constructor
A new instance of ButtonComponent.
- #overlay_classes ⇒ Object
Constructor Details
#initialize(name = "", html_options = {}, disabled: false, button_type: :filled) ⇒ ButtonComponent
Returns a new instance of ButtonComponent.
25 26 27 28 29 30 |
# File 'app/components/material/button_component.rb', line 25 def initialize(name = "", = {}, disabled: false, button_type: :filled) @name = name @html_options = disabled ? .merge(disabled: "disabled") : @disabled = disabled @button_type = end |
Instance Attribute Details
#button_type ⇒ Object (readonly)
Returns the value of attribute button_type.
23 24 25 |
# File 'app/components/material/button_component.rb', line 23 def @button_type end |
#disabled ⇒ Object (readonly)
Returns the value of attribute disabled.
22 23 24 |
# File 'app/components/material/button_component.rb', line 22 def disabled @disabled end |
Instance Method Details
#container_classes ⇒ Object
32 33 34 |
# File 'app/components/material/button_component.rb', line 32 def container_classes send :"#{}_button_container_classes" end |
#content_classes ⇒ Object
36 37 38 |
# File 'app/components/material/button_component.rb', line 36 def content_classes send :"#{}_button_content_classes" end |
#overlay_classes ⇒ Object
40 41 42 |
# File 'app/components/material/button_component.rb', line 40 def send :"#{}_button_overlay_classes" end |