class Sysdig::Response

Constants

BadRequest
Conflict
EXCEPTION_MAPPING
NotFound
Unexpected
Unprocessable

Attributes

body[R]
headers[R]
request[R]
status[R]

Public Class Methods

new(options={}) click to toggle source
# File lib/sysdig/response.rb, line 46
def initialize(options={})
  @status  = options[:status]
  @headers = options[:headers]
  @body    = options[:body]
  @request = options[:request]
end

Public Instance Methods

raise!() click to toggle source
# File lib/sysdig/response.rb, line 57
def raise!
  if !successful?
    raise((EXCEPTION_MAPPING[self.status] || Error).new(self))
  else self
  end
end
successful?() click to toggle source
# File lib/sysdig/response.rb, line 53
def successful?
  self.status >= 200 && self.status <= 299 || self.status == 304
end