Class: DoctorSwagger::ErrorResponse

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

Instance Method Summary collapse

Constructor Details

#initialize(http_status, error) ⇒ ErrorResponse

Returns a new instance of ErrorResponse.


3
4
5
6
# File 'lib/doctor_swagger/error_response.rb', line 3

def initialize(http_status, error)
  @error       = error
  @http_status = http_status
end

Instance Method Details

#as_jsonObject


8
9
10
11
12
13
# File 'lib/doctor_swagger/error_response.rb', line 8

def as_json(*)
  {
    'error'       => @error,
    'http_status' => @http_status
  }
end