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.
241 242 243 |
# File 'lib/jsonapi/exceptions.rb', line 241 def initialize() @messages = end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages.
240 241 242 |
# File 'lib/jsonapi/exceptions.rb', line 240 def @messages end |
Instance Method Details
#errors ⇒ Object
245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/jsonapi/exceptions.rb', line 245 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 |