Exception: StrongJSON::Type::UnexpectedAttributeError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/strong_json/type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, attribute:) ⇒ UnexpectedAttributeError

Returns a new instance of UnexpectedAttributeError.



343
344
345
346
347
# File 'lib/strong_json/type.rb', line 343

def initialize(path:, attribute:)
  @path = path
  @attribute = attribute
  super "UnexpectedAttributeError at #{path.to_s}: attribute=#{attribute}"
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



341
342
343
# File 'lib/strong_json/type.rb', line 341

def attribute
  @attribute
end

#pathObject (readonly)

Returns the value of attribute path.



341
342
343
# File 'lib/strong_json/type.rb', line 341

def path
  @path
end

Instance Method Details

#typeObject



349
350
351
# File 'lib/strong_json/type.rb', line 349

def type
  path.type
end