Class: Tmdby::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, uri, http_verb, post_params) ⇒ Response

Returns a new instance of Response.



7
8
9
10
11
12
13
14
15
# File 'lib/tmdby/response.rb', line 7

def initialize(response, uri, http_verb, post_params)
  @code = response.code
  @headers = response.to_hash
  @raw_body = response.body
  @body = JSON.parse(response.body)
  @uri = uri
  @http_verb = http_verb.upcase
  @post_params = post_params
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



5
6
7
# File 'lib/tmdby/response.rb', line 5

def body
  @body
end

#codeObject (readonly)

Returns the value of attribute code.



5
6
7
# File 'lib/tmdby/response.rb', line 5

def code
  @code
end

#headersObject (readonly)

Returns the value of attribute headers.



5
6
7
# File 'lib/tmdby/response.rb', line 5

def headers
  @headers
end

#http_verbObject (readonly)

Returns the value of attribute http_verb.



5
6
7
# File 'lib/tmdby/response.rb', line 5

def http_verb
  @http_verb
end

#post_paramsObject (readonly)

Returns the value of attribute post_params.



5
6
7
# File 'lib/tmdby/response.rb', line 5

def post_params
  @post_params
end

#raw_bodyObject (readonly)

Returns the value of attribute raw_body.



5
6
7
# File 'lib/tmdby/response.rb', line 5

def raw_body
  @raw_body
end

#uriObject (readonly)

Returns the value of attribute uri.



5
6
7
# File 'lib/tmdby/response.rb', line 5

def uri
  @uri
end