Class: Committee::ValidationError

Inherits:
Object
  • Object
show all
Defined in:
lib/firetail.rb

Overview

Instance Method Summary collapse

Instance Method Details

#error_bodyObject



248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/firetail.rb', line 248

def error_body
  {
    errors: [
      {
        type: "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}#{request.env['REQUEST_URI']}",
        title: id,
        detail: message,
        status: status
      }
    ]
  }
end

#renderObject



261
262
263
264
265
266
267
# File 'lib/firetail.rb', line 261

def render
  [
    status,
    { "Content-Type" => "application/json" },
    [JSON.generate(error_body)]
  ]
end