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_anchor_method_name ⇒ Object
- #ruby_target_method_name ⇒ Object
Constructor Details
#initialize(component:, target_name:) ⇒ TargetDefinition
Returns a new instance of TargetDefinition.
79 80 81 82 |
# File 'lib/phlex/stimulus/components/controller.rb', line 79 def initialize(component:, target_name:) @component = component @target_name = target_name end |
Instance Attribute Details
#component ⇒ Object (readonly)
74 75 76 |
# File 'lib/phlex/stimulus/components/controller.rb', line 74 def component @component end |
#target_name ⇒ Object (readonly)
76 77 78 |
# File 'lib/phlex/stimulus/components/controller.rb', line 76 def target_name @target_name end |
Instance Method Details
#ruby_name ⇒ Object
85 86 87 |
# File 'lib/phlex/stimulus/components/controller.rb', line 85 def ruby_name @target_name.underscore end |
#ruby_target_anchor_method_name ⇒ Object
95 96 97 |
# File 'lib/phlex/stimulus/components/controller.rb', line 95 def ruby_target_anchor_method_name "#{ruby_name}_target_anchor" end |
#ruby_target_method_name ⇒ Object
90 91 92 |
# File 'lib/phlex/stimulus/components/controller.rb', line 90 def ruby_target_method_name "#{ruby_name}_target" end |