Class: Tacokit::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client, res, options = {}) ⇒ Response

Returns a new instance of Response.


5
6
7
8
9
10
11
# File 'lib/tacokit/response.rb', line 5

def initialize(client, res, options = {})
  @client   = client
  @status   = res.status
  @headers  = res.headers
  @env      = res.env
  @data     = process_data(@client.deserialize(res.body))
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client


3
4
5
# File 'lib/tacokit/response.rb', line 3

def client
  @client
end

#dataObject (readonly)

Returns the value of attribute data


3
4
5
# File 'lib/tacokit/response.rb', line 3

def data
  @data
end

#envObject (readonly)

Returns the value of attribute env


3
4
5
# File 'lib/tacokit/response.rb', line 3

def env
  @env
end

#headersObject (readonly)

Returns the value of attribute headers


3
4
5
# File 'lib/tacokit/response.rb', line 3

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status


3
4
5
# File 'lib/tacokit/response.rb', line 3

def status
  @status
end