Class: Vident::StimulusAction
- Inherits:
-
StimulusAttributeBase
- Object
- StimulusAttributeBase
- Vident::StimulusAction
- Defined in:
- lib/vident/stimulus_action.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Attributes inherited from StimulusAttributeBase
Instance Method Summary collapse
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
#action ⇒ Object (readonly)
Returns the value of attribute action.
5 6 7 |
# File 'lib/vident/stimulus_action.rb', line 5 def action @action end |
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
5 6 7 |
# File 'lib/vident/stimulus_action.rb', line 5 def controller @controller end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
5 6 7 |
# File 'lib/vident/stimulus_action.rb', line 5 def event @event end |
Instance Method Details
#data_attribute_name ⇒ Object
15 16 17 |
# File 'lib/vident/stimulus_action.rb', line 15 def data_attribute_name "action" end |
#data_attribute_value ⇒ Object
19 20 21 |
# File 'lib/vident/stimulus_action.rb', line 19 def data_attribute_value to_s end |
#to_s ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/vident/stimulus_action.rb', line 7 def to_s if @event "#{@event}->#{@controller}##{@action}" else "#{@controller}##{@action}" end end |