class Sawyer::Response

Attributes

body[R]
env[R]

Public Class Methods

new(agent, res, options = {}) click to toggle source
# File lib/looker-sdk/sawyer_patch.rb, line 34
def initialize(agent, res, options = {})
  @agent   = agent
  @status  = res.status
  @headers = res.headers
  @env     = res.env
  @body    = res.body
  @rels    = process_rels
  @started = options[:sawyer_started]
  @ended   = options[:sawyer_ended]
end

Public Instance Methods

data() click to toggle source
# File lib/looker-sdk/sawyer_patch.rb, line 45
def data
  @data ||= begin
    return(body) unless (headers[:content_type] =~ /json|msgpack/)
    process_data(agent.decode_body(body))
  end
end
inspect() click to toggle source
# File lib/looker-sdk/sawyer_patch.rb, line 52
def inspect
  %(#<#{self.class}: #{@status} @rels=#{@rels.inspect} @data=#{data.inspect}>)
end