Module: Vident::ComponentClassLists
- Included in:
- Component
- Defined in:
- lib/vident/component_class_lists.rb
Instance Method Summary collapse
-
#class_list_for_stimulus_classes(*names) ⇒ Object
Getter for a stimulus classes list so can be used in view to set initial state on SSR Returns a String of classes that can be used in a ‘class` attribute.
-
#render_classes(root_element_html_class = nil) ⇒ Object
Generates the full list of HTML classes for the component.
Instance Method Details
#class_list_for_stimulus_classes(*names) ⇒ Object
Getter for a stimulus classes list so can be used in view to set initial state on SSR Returns a String of classes that can be used in a ‘class` attribute.
10 11 12 |
# File 'lib/vident/component_class_lists.rb', line 10 def class_list_for_stimulus_classes(*names) class_list_builder.build(@stimulus_classes_collection&.to_a, stimulus_class_names: names) || "" end |
#render_classes(root_element_html_class = nil) ⇒ Object
Generates the full list of HTML classes for the component
6 |
# File 'lib/vident/component_class_lists.rb', line 6 def render_classes(root_element_html_class = nil) = class_list_builder(root_element_html_class).build |