Exception: MightyJSON::Type::Error
- Inherits:
-
StandardError
- Object
- StandardError
- MightyJSON::Type::Error
- Defined in:
- lib/mighty_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.
229 230 231 232 233 |
# File 'lib/mighty_json/type.rb', line 229 def initialize(path:, type:, value:) @path = path @type = type @value = value end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
227 228 229 |
# File 'lib/mighty_json/type.rb', line 227 def path @path end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
227 228 229 |
# File 'lib/mighty_json/type.rb', line 227 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
227 228 229 |
# File 'lib/mighty_json/type.rb', line 227 def value @value end |
Instance Method Details
#to_s ⇒ Object
235 236 237 238 |
# File 'lib/mighty_json/type.rb', line 235 def to_s position = path.empty? ? "" : " at .#{path.join('.')}" "Expected type of value #{value}#{position} is #{type}" end |