Exception: Rhales::ParseError
- Defined in:
- lib/rhales/errors.rb
Overview
Parse-time errors - syntax and structure issues
Direct Known Subclasses
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#source_type ⇒ Object
readonly
Returns the value of attribute source_type.
Instance Method Summary collapse
-
#initialize(message, line: nil, column: nil, offset: nil, source_type: nil) ⇒ ParseError
constructor
A new instance of ParseError.
Constructor Details
#initialize(message, line: nil, column: nil, offset: nil, source_type: nil) ⇒ ParseError
Returns a new instance of ParseError.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rhales/errors.rb', line 10 def initialize(, line: nil, column: nil, offset: nil, source_type: nil) @line = line @column = column @offset = offset @source_type = source_type # :rue, :handlebars, or :template location = line && column ? " at line #{line}, column #{column}" : '' source = source_type ? " in #{source_type}" : '' super("#{}#{location}#{source}") end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
8 9 10 |
# File 'lib/rhales/errors.rb', line 8 def column @column end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
8 9 10 |
# File 'lib/rhales/errors.rb', line 8 def line @line end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
8 9 10 |
# File 'lib/rhales/errors.rb', line 8 def offset @offset end |
#source_type ⇒ Object (readonly)
Returns the value of attribute source_type.
8 9 10 |
# File 'lib/rhales/errors.rb', line 8 def source_type @source_type end |