Exception: Fibrio::ParseError

Inherits:
Error
  • Object
show all
Defined in:
lib/fibrio/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, position: nil) ⇒ ParseError

Returns a new instance of ParseError.

Parameters:

  • message (String)
  • position (Integer, nil) (defaults to: nil)

    byte offset in the input



12
13
14
15
# File 'lib/fibrio/errors.rb', line 12

def initialize(message, position: nil)
  @position = position
  super(position ? "#{message} (at byte #{position})" : message)
end

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



8
9
10
# File 'lib/fibrio/errors.rb', line 8

def position
  @position
end