Class: Synthra::Parser::AST::StatusDirective

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

Overview

Status directive

Sets the HTTP status code for a scenario.

Examples:

DSL

@status 200
@status 404

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code:, line: nil) ⇒ StatusDirective

Create a new StatusDirective

Parameters:

  • status_code (Integer)

    HTTP status code

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

    source line number



1149
1150
1151
1152
# File 'lib/synthra/parser/ast.rb', line 1149

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

Instance Attribute Details

#status_codeObject (readonly)

Returns the value of attribute status_code.



1141
1142
1143
# File 'lib/synthra/parser/ast.rb', line 1141

def status_code
  @status_code
end