Exception: StrongJSON::Type::UnexpectedFieldError
- Inherits:
-
StandardError
- Object
- StandardError
- StrongJSON::Type::UnexpectedFieldError
- Defined in:
- lib/strong_json/type.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(path:, value:) ⇒ UnexpectedFieldError
constructor
A new instance of UnexpectedFieldError.
- #to_s ⇒ Object
Constructor Details
#initialize(path:, value:) ⇒ UnexpectedFieldError
Returns a new instance of UnexpectedFieldError.
232 233 234 235 |
# File 'lib/strong_json/type.rb', line 232 def initialize(path: , value:) @path = path @value = value end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
230 231 232 |
# File 'lib/strong_json/type.rb', line 230 def path @path end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
230 231 232 |
# File 'lib/strong_json/type.rb', line 230 def value @value end |
Instance Method Details
#to_s ⇒ Object
237 238 239 240 |
# File 'lib/strong_json/type.rb', line 237 def to_s position = "#{path.join('.')}" "Unexpected field of #{position} (#{value})" end |