Exception: JsonMask::ParseError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/json_mask/error.rb

Overview

Raised when a field selector does not conform to the supported grammar.

Direct Known Subclasses

LimitError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, expression:, offset:) ⇒ ParseError

Returns a new instance of ParseError.



8
9
10
11
12
13
14
# File 'lib/json_mask/error.rb', line 8

def initialize(reason, expression:, offset:)
  @reason = reason
  @expression = expression
  @offset = offset

  super("#{reason} at offset #{offset}")
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



6
7
8
# File 'lib/json_mask/error.rb', line 6

def expression
  @expression
end

#offsetObject (readonly)

Returns the value of attribute offset.



6
7
8
# File 'lib/json_mask/error.rb', line 6

def offset
  @offset
end

#reasonObject (readonly)

Returns the value of attribute reason.



6
7
8
# File 'lib/json_mask/error.rb', line 6

def reason
  @reason
end