Exception: JSON::JSONRepairError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/json/repair.rb,
sig/json/repair.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, position = nil) ⇒ JSONRepairError

Returns a new instance of JSONRepairError.

Parameters:

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


12
13
14
15
# File 'lib/json/repair.rb', line 12

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

Instance Attribute Details

#position::Integer? (readonly)

Returns the value of attribute position.

Returns:

  • (::Integer, nil)


10
11
12
# File 'lib/json/repair.rb', line 10

def position
  @position
end