Class: Phlex::Stimulus::Components::Controller::ActionDefinition
- Inherits:
-
Object
- Object
- Phlex::Stimulus::Components::Controller::ActionDefinition
- Defined in:
- lib/phlex/stimulus/components/controller.rb
Instance Attribute Summary collapse
- #action_name ⇒ Object readonly
- #component ⇒ Object readonly
Instance Method Summary collapse
- #full_name ⇒ Object
-
#initialize(component:, action_name:) ⇒ ActionDefinition
constructor
A new instance of ActionDefinition.
- #ruby_action_method_name ⇒ Object
- #ruby_name ⇒ Object
Constructor Details
#initialize(component:, action_name:) ⇒ ActionDefinition
Returns a new instance of ActionDefinition.
18 19 20 21 |
# File 'lib/phlex/stimulus/components/controller.rb', line 18 def initialize(component:, action_name:) @component = component @action_name = action_name end |
Instance Attribute Details
#action_name ⇒ Object (readonly)
15 16 17 |
# File 'lib/phlex/stimulus/components/controller.rb', line 15 def action_name @action_name end |
#component ⇒ Object (readonly)
13 14 15 |
# File 'lib/phlex/stimulus/components/controller.rb', line 13 def component @component end |
Instance Method Details
#full_name ⇒ Object
24 25 26 |
# File 'lib/phlex/stimulus/components/controller.rb', line 24 def full_name "#{@component.controller_name}##{@action_name}" end |
#ruby_action_method_name ⇒ Object
34 35 36 |
# File 'lib/phlex/stimulus/components/controller.rb', line 34 def ruby_action_method_name "#{ruby_name}_action" end |
#ruby_name ⇒ Object
29 30 31 |
# File 'lib/phlex/stimulus/components/controller.rb', line 29 def ruby_name @action_name.underscore end |