Module: ChefStash::Response

Defined in:
lib/chef_stash/utils.rb

Constant Summary collapse

HTTP_STATUS_CODES =
{
  200 => 'OK',
  201 => 'Created',
  202 => 'Accepted',
  203 => 'Non-Authoritative Information',
  204 => 'No Content',
  205 => 'Reset Content',
  206 => 'Partial Content',
  300 => 'Multiple Choices',
  301 => 'Moved Permanently',
  302 => 'Found',
  303 => 'See Other',
  304 => 'Not Modified',
  305 => 'Use Proxy',
  306 => 'Switch Proxy',
  307 => 'Temporary Redirect',
  308 => 'Permanent Redirect',
  400 => 'BadRequest',
  401 => 'Unauthorized',
  403 => 'Forbidden',
  404 => 'NotFound',
  405 => 'MethodNotAllowed',
  406 => 'AccessDenied',
  409 => 'Conflict',
  410 => 'Gone',
  500 => 'InternalServerError',
  501 => 'NotImplemented',
  502 => 'BadGateway',
  503 => 'ServiceUnavailable',
  504 => 'GatewayTimeout',
}

Class Method Summary collapse

Class Method Details

.code(code) ⇒ Object



54
55
56
57
# File 'lib/chef_stash/utils.rb', line 54

def self.code(code)
  status = HTTP_STATUS_CODES[code]
  code.to_s + ' ' + status
end