Exception: JSONAPI::Exceptions::ValidationErrors
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
Returns the value of attribute messages.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(messages) ⇒ ValidationErrors
constructor
A new instance of ValidationErrors.
Constructor Details
#initialize(messages) ⇒ ValidationErrors
Returns a new instance of ValidationErrors.
272 273 274 |
# File 'lib/jsonapi/exceptions.rb', line 272 def initialize() @messages = end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages.
271 272 273 |
# File 'lib/jsonapi/exceptions.rb', line 271 def @messages end |
Instance Method Details
#errors ⇒ Object
276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/jsonapi/exceptions.rb', line 276 def errors .inject([]) do |arr, element| arr.concat( element[1].map do || JSONAPI::Error.new(code: JSONAPI::VALIDATION_ERROR, status: :unprocessable_entity, title: "#{element[0]} - #{}", detail: , path: "/#{element[0]}") end ) end end |