Class: Purple::Response

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

Overview

Implements basic response object

Constant Summary collapse

CODES =
{
  ok: 200,
  created: 201,
  accepted: 202,
  bad_request: 400,
  unauthorized: 401,
  unprocessable_entity: 422,
  forbidden: 403,
  not_found: 404,
  too_many_requests: 429,
  internal_server_error: 500,
  gateway_timeout: 504,
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



10
11
12
# File 'lib/purple/response.rb', line 10

def body
  @body
end

Instance Method Details

#status_codeObject



26
27
28
# File 'lib/purple/response.rb', line 26

def status_code
  CODES[@status]
end