Exception: JsonMessage::ValidationError
- Defined in:
- lib/json_message.rb
Overview
One or more field’s values didn’t match their schema
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(errors) ⇒ ValidationError
constructor
A new instance of ValidationError.
- #to_s ⇒ Object
Constructor Details
#initialize(errors) ⇒ ValidationError
Returns a new instance of ValidationError.
24 25 26 |
# File 'lib/json_message.rb', line 24 def initialize(errors) @errors = errors end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
22 23 24 |
# File 'lib/json_message.rb', line 22 def errors @errors end |
Instance Method Details
#to_s ⇒ Object
28 29 30 31 |
# File 'lib/json_message.rb', line 28 def to_s err_strs = @errors.map { |f, e| "Field: #{f}, Error: #{e}" } err_strs.join(', ') end |