Class: Vident::StimulusClass
- Inherits:
-
StimulusAttributeBase
- Object
- StimulusAttributeBase
- Vident::StimulusClass
- Defined in:
- lib/vident/stimulus_class.rb
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#css_classes ⇒ Object
readonly
Returns the value of attribute css_classes.
Attributes inherited from StimulusAttributeBase
Instance Method Summary collapse
Methods inherited from StimulusAttributeBase
#implied_controller_name, #implied_controller_path, #initialize, #inspect, js_name, stimulize_path, #to_h
Constructor Details
This class inherits a constructor from Vident::StimulusAttributeBase
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
5 6 7 |
# File 'lib/vident/stimulus_class.rb', line 5 def class_name @class_name end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
5 6 7 |
# File 'lib/vident/stimulus_class.rb', line 5 def controller @controller end |
#css_classes ⇒ Object (readonly)
Returns the value of attribute css_classes.
5 6 7 |
# File 'lib/vident/stimulus_class.rb', line 5 def css_classes @css_classes end |
Instance Method Details
#data_attribute_name ⇒ Object
9 |
# File 'lib/vident/stimulus_class.rb', line 9 def data_attribute_name = "#{@controller}-#{@class_name}-class" |
#data_attribute_value ⇒ Object
11 |
# File 'lib/vident/stimulus_class.rb', line 11 def data_attribute_value = to_s |
#to_s ⇒ Object
7 |
# File 'lib/vident/stimulus_class.rb', line 7 def to_s = @css_classes.join(" ") |