Class: Vident::StimulusTarget
- Inherits:
-
StimulusAttributeBase
- Object
- StimulusAttributeBase
- Vident::StimulusTarget
- Defined in:
- lib/vident/stimulus_target.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from StimulusAttributeBase
Instance Method Summary collapse
-
#data_attribute_name ⇒ Object
Returns the data attribute name for this target.
-
#data_attribute_value ⇒ Object
Returns the target name value for the data attribute.
- #to_s ⇒ Object
Methods inherited from StimulusAttributeBase
#implied_controller_name, #implied_controller_path, #initialize, #inspect, #to_h
Constructor Details
This class inherits a constructor from Vident::StimulusAttributeBase
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
5 6 7 |
# File 'lib/vident/stimulus_target.rb', line 5 def controller @controller end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/vident/stimulus_target.rb', line 5 def name @name end |
Instance Method Details
#data_attribute_name ⇒ Object
Returns the data attribute name for this target
12 13 14 |
# File 'lib/vident/stimulus_target.rb', line 12 def data_attribute_name "#{@controller}-target" end |
#data_attribute_value ⇒ Object
Returns the target name value for the data attribute
17 18 19 |
# File 'lib/vident/stimulus_target.rb', line 17 def data_attribute_value @name end |
#to_s ⇒ Object
7 8 9 |
# File 'lib/vident/stimulus_target.rb', line 7 def to_s @name end |