Exception: TSJSON::ScalarValidationError
- Inherits:
-
ValidationError
- Object
- StandardError
- ValidationError
- TSJSON::ScalarValidationError
- Defined in:
- lib/errors/scalar_validation_error.rb
Instance Method Summary collapse
-
#initialize(expected_type:, received_type:, received_value:) ⇒ ScalarValidationError
constructor
A new instance of ScalarValidationError.
- #to_human_json ⇒ Object
Methods inherited from ValidationError
Constructor Details
#initialize(expected_type:, received_type:, received_value:) ⇒ ScalarValidationError
Returns a new instance of ScalarValidationError.
3 4 5 |
# File 'lib/errors/scalar_validation_error.rb', line 3 def initialize(expected_type:, received_type:, received_value:) super end |
Instance Method Details
#to_human_json ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/errors/scalar_validation_error.rb', line 7 def to_human_json { message: "Expected type `#{@details[:expected_type]}`. Received value `#{ @details[:received_value] }` of type `#{@details[:received_type]}`" } end |