Class: FoxTail::SpinnerComponent
- Inherits:
-
InlineSvgComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- InlineSvgComponent
- FoxTail::SpinnerComponent
- Defined in:
- app/components/fox_tail/spinner_component.rb
Instance Attribute Summary
Attributes inherited from InlineSvgComponent
Attributes inherited from BaseComponent
Class Method Summary collapse
Instance Method Summary collapse
- #before_render ⇒ Object
- #html_class ⇒ Object
-
#initialize(html_attributes = {}) ⇒ SpinnerComponent
constructor
A new instance of SpinnerComponent.
Methods inherited from InlineSvgComponent
Methods inherited from BaseComponent
classname_merger, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
Constructor Details
#initialize(html_attributes = {}) ⇒ SpinnerComponent
Returns a new instance of SpinnerComponent.
7 8 9 10 |
# File 'app/components/fox_tail/spinner_component.rb', line 7 def initialize(html_attributes = {}) path = html_attributes.delete(:path) { self.class.spinner_path } super(path, html_attributes) end |
Class Method Details
Instance Method Details
#before_render ⇒ Object
12 13 14 15 16 17 |
# File 'app/components/fox_tail/spinner_component.rb', line 12 def before_render super html_attributes[:"aria-hidden"] = true html_attributes[:role] = :status end |
#html_class ⇒ Object
19 20 21 |
# File 'app/components/fox_tail/spinner_component.rb', line 19 def html_class classnames theme.apply(:root, self), super end |