Class: RailsOpenapiGen::Parsers::Jbuilder::CallDetectors::BaseDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/rails-openapi-gen/parsers/jbuilder/call_detectors/base_detector.rb

Overview

Base class for all call detectors Provides common interface and utility methods for detecting Jbuilder method calls

Class Method Summary collapse

Class Method Details

.categorySymbol

Get the category of this detector for organization

Returns:

  • (Symbol)

    Detector category



26
27
28
# File 'lib/rails-openapi-gen/parsers/jbuilder/call_detectors/base_detector.rb', line 26

def category
  :general
end

.descriptionString

Get human-readable description of what this detector handles

Returns:

  • (String)

    Description



32
33
34
# File 'lib/rails-openapi-gen/parsers/jbuilder/call_detectors/base_detector.rb', line 32

def description
  "Base detector"
end

.handles?(_receiver, _method_name, _args = []) ⇒ Boolean

Check if a method call matches this detector's patterns

Parameters:

  • receiver (Parser::AST::Node, nil)

    Method receiver node

  • method_name (Symbol)

    Method name

  • args (Array<Parser::AST::Node>)

    Method arguments

Returns:

  • (Boolean)

    True if this detector handles the method call

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/rails-openapi-gen/parsers/jbuilder/call_detectors/base_detector.rb', line 13

def handles?(_receiver, _method_name, _args = [])
  raise NotImplementedError, "#{self} must implement #handles?"
end

.priorityInteger

Get the detection priority for this detector Higher priority detectors are checked first

Returns:

  • (Integer)

    Priority value (higher = more priority)



20
21
22
# File 'lib/rails-openapi-gen/parsers/jbuilder/call_detectors/base_detector.rb', line 20

def priority
  0
end