Class: Phlex::Stimulus::Components::Controller::TargetDefinition
- Inherits:
-
Object
- Object
- Phlex::Stimulus::Components::Controller::TargetDefinition
- Defined in:
- lib/phlex/stimulus/components/controller.rb
Instance Attribute Summary collapse
- #component ⇒ Object readonly
- #target_name ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(component:, target_name:) ⇒ TargetDefinition
constructor
A new instance of TargetDefinition.
- #ruby_name ⇒ Object
- #ruby_target_method_name ⇒ Object
Constructor Details
#initialize(component:, target_name:) ⇒ TargetDefinition
Returns a new instance of TargetDefinition.
46 47 48 49 |
# File 'lib/phlex/stimulus/components/controller.rb', line 46 def initialize(component:, target_name:) @component = component @target_name = target_name end |
Instance Attribute Details
#component ⇒ Object (readonly)
41 42 43 |
# File 'lib/phlex/stimulus/components/controller.rb', line 41 def component @component end |
#target_name ⇒ Object (readonly)
43 44 45 |
# File 'lib/phlex/stimulus/components/controller.rb', line 43 def target_name @target_name end |
Instance Method Details
#ruby_name ⇒ Object
52 53 54 |
# File 'lib/phlex/stimulus/components/controller.rb', line 52 def ruby_name @target_name.underscore end |
#ruby_target_method_name ⇒ Object
57 58 59 |
# File 'lib/phlex/stimulus/components/controller.rb', line 57 def ruby_target_method_name "#{ruby_name}_target" end |