Exception: StrongJSON::Type::TypeError
- Inherits:
-
StandardError
- Object
- StandardError
- StrongJSON::Type::TypeError
- 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:) ⇒ TypeError
constructor
A new instance of TypeError.
- #type ⇒ Object
Constructor Details
#initialize(path:, value:) ⇒ TypeError
Returns a new instance of TypeError.
388 389 390 391 392 393 394 |
# File 'lib/strong_json/type.rb', line 388 def initialize(path:, value:) @path = path @value = value type = path.type s = type.alias || type super "TypeError at #{path.to_s}: expected=#{s}, value=#{value.inspect}" end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
386 387 388 |
# File 'lib/strong_json/type.rb', line 386 def path @path end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
386 387 388 |
# File 'lib/strong_json/type.rb', line 386 def value @value end |
Instance Method Details
#type ⇒ Object
396 397 398 |
# File 'lib/strong_json/type.rb', line 396 def type path.type end |