Class: ViewComponent::Form::ButtonComponent
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- ViewComponent::Form::ButtonComponent
- Defined in:
- app/components/view_component/form/button_component.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from BaseComponent
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(form, value, options = {}) ⇒ ButtonComponent
constructor
A new instance of ButtonComponent.
Methods inherited from BaseComponent
#html_class, #object_errors, #object_errors?
Methods included from ClassNamesHelper
#build_tag_values, #class_names
Constructor Details
#initialize(form, value, options = {}) ⇒ ButtonComponent
Returns a new instance of ButtonComponent.
8 9 10 11 12 |
# File 'app/components/view_component/form/button_component.rb', line 8 def initialize(form, value, = {}) @value = value super(form, nil, ) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'app/components/view_component/form/button_component.rb', line 6 def value @value end |
Instance Method Details
#call ⇒ Object
14 15 16 |
# File 'app/components/view_component/form/button_component.rb', line 14 def call (content || value, ) end |