Exception: RDParser::ParseError
- Inherits:
-
StandardError
- Object
- StandardError
- RDParser::ParseError
- Defined in:
- lib/rdparser/parse_error.rb
Overview
raised when Parser cannot get through the entire string.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
Instance Method Summary collapse
-
#initialize(content, position) ⇒ ParseError
constructor
A new instance of ParseError.
Constructor Details
#initialize(content, position) ⇒ ParseError
Returns a new instance of ParseError.
4 5 6 7 8 |
# File 'lib/rdparser/parse_error.rb', line 4 def initialize content, position super(%{Cannot parse the entire content! (error was on position ##{position}: "#{content[0...position]}|#{content[position..position]}|#{content[position+1..-1]}")}) @content = content @position = position end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
3 4 5 |
# File 'lib/rdparser/parse_error.rb', line 3 def content @content end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
3 4 5 |
# File 'lib/rdparser/parse_error.rb', line 3 def position @position end |