Exception: Chutzen::Expression::SyntaxError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/chutzen/expression/syntax_error.rb

Overview

Raised when something went wrong while parsing a Chutzen expression.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, expression: nil) ⇒ SyntaxError

Returns a new instance of SyntaxError.



9
10
11
12
# File 'lib/chutzen/expression/syntax_error.rb', line 9

def initialize(message, expression: nil)
  super(message)
  @expression = expression
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



7
8
9
# File 'lib/chutzen/expression/syntax_error.rb', line 7

def expression
  @expression
end

Instance Method Details

#as_jsonObject



14
15
16
# File 'lib/chutzen/expression/syntax_error.rb', line 14

def as_json
  { 'error' => details }
end