Class: Taro::Rails::Declaration
- Inherits:
-
Declaration
- Object
- Declaration
- Taro::Rails::Declaration
- Defined in:
- lib/taro/rails/declaration.rb
Instance Attribute Summary collapse
-
#action_name ⇒ Object
readonly
Returns the value of attribute action_name.
-
#controller_class ⇒ Object
readonly
Returns the value of attribute controller_class.
Attributes inherited from Declaration
#desc, #params, #return_defs, #return_descriptions, #summary, #tags
Instance Method Summary collapse
Methods inherited from Declaration
#add_info, #add_param, #add_return, #initialize, #inspect, #polymorphic_route?, #returns
Constructor Details
This class inherits a constructor from Taro::Declaration
Instance Attribute Details
#action_name ⇒ Object (readonly)
Returns the value of attribute action_name.
2 3 4 |
# File 'lib/taro/rails/declaration.rb', line 2 def action_name @action_name end |
#controller_class ⇒ Object (readonly)
Returns the value of attribute controller_class.
2 3 4 |
# File 'lib/taro/rails/declaration.rb', line 2 def controller_class @controller_class end |
Instance Method Details
#endpoint ⇒ Object
10 11 12 |
# File 'lib/taro/rails/declaration.rb', line 10 def endpoint action_name && "#{controller_class}##{action_name}" end |
#finalize(controller_class:, action_name:) ⇒ Object
4 5 6 7 8 |
# File 'lib/taro/rails/declaration.rb', line 4 def finalize(controller_class:, action_name:) @controller_class = controller_class @action_name = action_name @params.define_name("InputType(#{endpoint})") end |
#routes ⇒ Object
14 15 16 |
# File 'lib/taro/rails/declaration.rb', line 14 def routes @routes ||= Taro::Rails::RouteFinder.call(controller_class:, action_name:) end |