Exception: Chutzen::Template::SyntaxError

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

Overview

Raised when something went wrong while parsing a Chutzen template.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, template: nil) ⇒ SyntaxError

Returns a new instance of SyntaxError.



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

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

Instance Attribute Details

#templateObject (readonly)

Returns the value of attribute template.



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

def template
  @template
end

Instance Method Details

#as_jsonObject



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

def as_json
  { 'error' => details }
end