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.
227 228 229 |
# File 'lib/jsonapi/exceptions.rb', line 227 def initialize() @messages = end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages.
226 227 228 |
# File 'lib/jsonapi/exceptions.rb', line 226 def @messages end |
Instance Method Details
#errors ⇒ Object
231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/jsonapi/exceptions.rb', line 231 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 |