Class: Clientele::Response

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Response

Returns a new instance of Response.



20
21
22
# File 'lib/clientele/response.rb', line 20

def initialize(response)
  super @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



19
20
21
# File 'lib/clientele/response.rb', line 19

def response
  @response
end

Class Method Details

.build(response, resource, client) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/clientele/response.rb', line 10

def build(response, resource, client)
  if resource
    resource.build(response.body, response: response, client: client)
  else
    new response
  end
end