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.
285 286 287 |
# File 'lib/jsonapi/exceptions.rb', line 285 def initialize() = end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages.
284 285 286 |
# File 'lib/jsonapi/exceptions.rb', line 284 def end |
Instance Method Details
#errors ⇒ Object
289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/jsonapi/exceptions.rb', line 289 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]} - #{message}", detail: , path: "/#{element[0]}") end ) end end |