Class: Vident::StimulusTarget

Inherits:
StimulusAttributeBase show all
Defined in:
lib/vident/stimulus_target.rb

Instance Attribute Summary collapse

Attributes inherited from StimulusAttributeBase

#implied_controller

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

#controllerObject (readonly)

Returns the value of attribute controller.



5
6
7
# File 'lib/vident/stimulus_target.rb', line 5

def controller
  @controller
end

#nameObject (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_nameObject

Returns the data attribute name for this target



10
# File 'lib/vident/stimulus_target.rb', line 10

def data_attribute_name = "#{@controller}-target"

#data_attribute_valueObject

Returns the target name value for the data attribute



13
# File 'lib/vident/stimulus_target.rb', line 13

def data_attribute_value = @name

#to_sObject



7
# File 'lib/vident/stimulus_target.rb', line 7

def to_s = @name