class MightyJSON::Error

Attributes

path[R]
type[R]
value[R]

Public Class Methods

new(path:, type:, value:) click to toggle source
# File lib/mighty_json/errors.rb, line 7
def initialize(path:, type:, value:)
  @path = path
  @type = type
  @value = value
end

Public Instance Methods

message()
Alias for: to_s
to_s() click to toggle source
# File lib/mighty_json/errors.rb, line 13
def to_s
  position = path.empty? ? "" : " at .#{path.join('.')}"
  "Expected type of value #{value}#{position} is #{type}"
end
Also aliased as: message