Exception: StrongJSON::Type::Error
- Inherits:
-
StandardError
- Object
- StandardError
- StrongJSON::Type::Error
- Defined in:
- lib/strong_json/type.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(path:, type:, value:) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
Constructor Details
#initialize(path:, type:, value:) ⇒ Error
Returns a new instance of Error.
251 252 253 254 255 |
# File 'lib/strong_json/type.rb', line 251 def initialize(path:, type:, value:) @path = path @type = type @value = value end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
249 250 251 |
# File 'lib/strong_json/type.rb', line 249 def path @path end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
249 250 251 |
# File 'lib/strong_json/type.rb', line 249 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
249 250 251 |
# File 'lib/strong_json/type.rb', line 249 def value @value end |
Instance Method Details
#to_s ⇒ Object
257 258 259 260 |
# File 'lib/strong_json/type.rb', line 257 def to_s position = path.empty? ? "" : " at .#{path.join('.')}" "Expected type of value #{value}#{position} is #{type}" end |