Class: AtomicView::Components::SubmitComponent
- Inherits:
-
ViewComponent::Form::SubmitComponent
- Object
- ViewComponent::Form::SubmitComponent
- AtomicView::Components::SubmitComponent
- Defined in:
- lib/atomic_view/components/submit_component.rb
Instance Attribute Summary collapse
-
#variant ⇒ Object
readonly
Returns the value of attribute variant.
Instance Method Summary collapse
- #html_class ⇒ Object
-
#initialize(form, value_or_options = nil, options = nil) ⇒ SubmitComponent
constructor
A new instance of SubmitComponent.
Constructor Details
#initialize(form, value_or_options = nil, options = nil) ⇒ SubmitComponent
Returns a new instance of SubmitComponent.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/atomic_view/components/submit_component.rb', line 6 def initialize(form, = nil, = nil) super if .is_a?(Hash) = else ||= {} end @variant = .delete(:variant) || :primary end |
Instance Attribute Details
#variant ⇒ Object (readonly)
Returns the value of attribute variant.
4 5 6 |
# File 'lib/atomic_view/components/submit_component.rb', line 4 def variant @variant end |
Instance Method Details
#html_class ⇒ Object
18 19 20 |
# File 'lib/atomic_view/components/submit_component.rb', line 18 def html_class class_names(base_classes, variant_classes, [:class]) end |