Class: Synthra::Parser::AST::MethodDirective

Inherits:
DirectiveNode show all
Defined in:
lib/synthra/parser/ast.rb

Overview

Method directive

Associates a scenario with specific HTTP methods. Used in the legacy response scenarios format.

Examples:

DSL

@method GET
@method POST

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_method:, line: nil) ⇒ MethodDirective

Create a new MethodDirective

Parameters:

  • http_method (Symbol)

    HTTP method

  • line (Integer, nil) (defaults to: nil)

    source line number



1280
1281
1282
1283
# File 'lib/synthra/parser/ast.rb', line 1280

def initialize(http_method:, line: nil)
  super(line: line)
  @http_method = http_method
end

Instance Attribute Details

#http_methodObject (readonly)

Returns the value of attribute http_method.



1272
1273
1274
# File 'lib/synthra/parser/ast.rb', line 1272

def http_method
  @http_method
end