Class: RailsOpenapiGen::Parsers::Jbuilder::Processors::PropertyProcessor

Inherits:
BaseProcessor
  • Object
show all
Defined in:
lib/rails-openapi-gen/parsers/jbuilder/processors/property_processor.rb

Constant Summary collapse

CallDetectors =

Alias for shorter reference to call detectors

RailsOpenapiGen::Parsers::Jbuilder::CallDetectors

Constants inherited from BaseProcessor

BaseProcessor::JbuilderParser

Instance Method Summary collapse

Methods inherited from BaseProcessor

#handler_missing, #initialize, #on_if, #partials, #properties

Constructor Details

This class inherits a constructor from RailsOpenapiGen::Parsers::Jbuilder::Processors::BaseProcessor

Instance Method Details

#on_send(node) ⇒ void

This method returns an undefined value.

Processes method call nodes for simple property assignments



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rails-openapi-gen/parsers/jbuilder/processors/property_processor.rb', line 13

def on_send(node)
  receiver, method_name, *args = node.children

  if CallDetectors::JsonCallDetector.json_property?(receiver, method_name)
    process_json_property(node, method_name.to_s, args)
  else
    # For non-JSON property calls, don't process anything to avoid creating
    # properties for variable access calls
    super
  end
end