Class: Maglev::Uikit::Form::Richtext::ButtonComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Maglev::Uikit::Form::Richtext::ButtonComponent
- Defined in:
- app/components/maglev/uikit/form/richtext/button_component.rb
Instance Attribute Summary collapse
-
#action_name ⇒ Object
readonly
Returns the value of attribute action_name.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:, icon:, action_name: nil) ⇒ ButtonComponent
constructor
A new instance of ButtonComponent.
Constructor Details
#initialize(name:, icon:, action_name: nil) ⇒ ButtonComponent
Returns a new instance of ButtonComponent.
10 11 12 13 14 |
# File 'app/components/maglev/uikit/form/richtext/button_component.rb', line 10 def initialize(name:, icon:, action_name: nil) @name = name @action_name = action_name.presence || "toggle#{name.camelize}" @icon = icon end |
Instance Attribute Details
#action_name ⇒ Object (readonly)
Returns the value of attribute action_name.
8 9 10 |
# File 'app/components/maglev/uikit/form/richtext/button_component.rb', line 8 def action_name @action_name end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
8 9 10 |
# File 'app/components/maglev/uikit/form/richtext/button_component.rb', line 8 def icon @icon end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'app/components/maglev/uikit/form/richtext/button_component.rb', line 8 def name @name end |