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
: singleton(Controller).
-
#target_name ⇒ Object
readonly
: String.
Instance Method Summary collapse
-
#initialize(component:, target_name:) ⇒ TargetDefinition
constructor
: (component: singleton(Controller), target_name: String) -> void.
-
#ruby_name ⇒ Object
: -> String.
-
#ruby_target_method_name ⇒ Object
: -> String.
Constructor Details
#initialize(component:, target_name:) ⇒ TargetDefinition
: (component: singleton(Controller), target_name: String) -> void
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)
: singleton(Controller)
41 42 43 |
# File 'lib/phlex/stimulus/components/controller.rb', line 41 def component @component end |
#target_name ⇒ Object (readonly)
: String
43 44 45 |
# File 'lib/phlex/stimulus/components/controller.rb', line 43 def target_name @target_name end |
Instance Method Details
#ruby_name ⇒ Object
: -> String
52 53 54 |
# File 'lib/phlex/stimulus/components/controller.rb', line 52 def ruby_name @target_name.underscore end |
#ruby_target_method_name ⇒ Object
: -> String
57 58 59 |
# File 'lib/phlex/stimulus/components/controller.rb', line 57 def ruby_target_method_name "#{ruby_name}_target" end |