Class: FoxTail::SpinnerComponent
Instance Attribute Summary
#path
#html_attributes
Class Method Summary
collapse
Instance Method Summary
collapse
#call
classname_merger, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
fox_tail_config
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
.spinner_path ⇒ Object
24
25
26
|
# File 'app/components/fox_tail/spinner_component.rb', line 24
def spinner_path
FoxTail.root.join "app/assets/vendor/spinner.svg"
end
|
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
|