Class: RailsOpenapiGen::Parsers::ControllerParser::ActionMethodProcessor
- Inherits:
-
Parser::AST::Processor
- Object
- Parser::AST::Processor
- RailsOpenapiGen::Parsers::ControllerParser::ActionMethodProcessor
- Defined in:
- lib/rails-openapi-gen/parsers/controller_parser.rb
Instance Attribute Summary collapse
-
#action_node ⇒ Object
readonly
Returns the value of attribute action_node.
Instance Method Summary collapse
-
#initialize(action_name) ⇒ ActionMethodProcessor
constructor
Initializes processor to find specific action method.
-
#on_def(node) ⇒ void
Processes method definition nodes.
Constructor Details
#initialize(action_name) ⇒ ActionMethodProcessor
Initializes processor to find specific action method
180 181 182 183 184 |
# File 'lib/rails-openapi-gen/parsers/controller_parser.rb', line 180 def initialize(action_name) super() @action_name = action_name.to_sym @action_node = nil end |
Instance Attribute Details
#action_node ⇒ Object (readonly)
Returns the value of attribute action_node.
176 177 178 |
# File 'lib/rails-openapi-gen/parsers/controller_parser.rb', line 176 def action_node @action_node end |
Instance Method Details
#on_def(node) ⇒ void
This method returns an undefined value.
Processes method definition nodes
189 190 191 192 193 |
# File 'lib/rails-openapi-gen/parsers/controller_parser.rb', line 189 def on_def(node) method_name = node.children[0] @action_node = node if method_name == @action_name super end |