Exception: HRX::ParseError
- Defined in:
- lib/hrx/parse_error.rb
Overview
An error caused by an HRX file failing to parse correctly.
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
The 1-based column of the line on which the error occurred.
-
#file ⇒ Object
readonly
The file which failed to parse, or ‘nil` if the filename isn’t known.
-
#line ⇒ Object
readonly
The 1-based line of the document on which the error occurred.
Instance Method Summary collapse
-
#initialize(message, line, column, file: nil) ⇒ ParseError
constructor
A new instance of ParseError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, line, column, file: nil) ⇒ ParseError
Returns a new instance of ParseError.
28 29 30 31 32 33 |
# File 'lib/hrx/parse_error.rb', line 28 def initialize(, line, column, file: nil) super() @line = line @column = column @file = file end |
Instance Attribute Details
#column ⇒ Object (readonly)
The 1-based column of the line on which the error occurred.
23 24 25 |
# File 'lib/hrx/parse_error.rb', line 23 def column @column end |
#file ⇒ Object (readonly)
The file which failed to parse, or ‘nil` if the filename isn’t known.
26 27 28 |
# File 'lib/hrx/parse_error.rb', line 26 def file @file end |
#line ⇒ Object (readonly)
The 1-based line of the document on which the error occurred.
20 21 22 |
# File 'lib/hrx/parse_error.rb', line 20 def line @line end |
Instance Method Details
#to_s ⇒ Object
35 36 37 38 39 |
# File 'lib/hrx/parse_error.rb', line 35 def to_s buffer = String.new("Parse error on line #{line}, column #{column}") buffer << " of #{file}" if file buffer << ": #{super.to_s}" end |