Method: Orchestrate::API::ItemResponse#initialize

Defined in:
lib/orchestrate/api/response.rb

#initialize(faraday_response, client) ⇒ ItemResponse

Instantiate a new Respose

Parameters:

  • faraday_response (Faraday::Response)

    The Faraday response object.

  • client (Orchestrate::Client)

    The client used to generate the response.



90
91
92
93
94
95
96
# File 'lib/orchestrate/api/response.rb', line 90

def initialize(faraday_response, client)
  super(faraday_response, client)
  @response.on_complete do
    @location = headers['Content-Location'] || headers['Location']
    @ref = headers.fetch('Etag','').gsub('"','').sub(/-gzip$/,'')
  end
end