Exception: TSJSON::UnexpectedValueError
- Inherits:
-
ValidationError
- Object
- StandardError
- ValidationError
- TSJSON::UnexpectedValueError
- Defined in:
- lib/errors/unexpected_value_error.rb
Instance Method Summary collapse
-
#initialize(field:, expected_values:, received:) ⇒ UnexpectedValueError
constructor
A new instance of UnexpectedValueError.
- #to_human_json ⇒ Object
Methods inherited from ValidationError
Constructor Details
#initialize(field:, expected_values:, received:) ⇒ UnexpectedValueError
Returns a new instance of UnexpectedValueError.
3 4 5 |
# File 'lib/errors/unexpected_value_error.rb', line 3 def initialize(field:, expected_values:, received:) super end |
Instance Method Details
#to_human_json ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/errors/unexpected_value_error.rb', line 7 def to_human_json { message: "Field '#{@details[:field]}' received unexpected value '#{ @details[:received] }'. Expected values are: #{@details[:expected_values].join(', ')}" } end |