Exception: RDParser::ParseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/rdparser/parse_error.rb

Overview

raised when Parser cannot get through the entire string.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentObject (readonly)

Returns the value of attribute content.



3
4
5
# File 'lib/rdparser/parse_error.rb', line 3

def content
  @content
end

#positionObject (readonly)

Returns the value of attribute position.



3
4
5
# File 'lib/rdparser/parse_error.rb', line 3

def position
  @position
end