Class: Orchestrate::API::ItemResponse
- Defined in:
- lib/orchestrate/api/response.rb
Overview
A generic response for a single entity (K/V, Ref, Event)
Instance Attribute Summary collapse
-
#location ⇒ String
readonly
The 'Location' of the item.
-
#ref ⇒ String
readonly
The canonical 'ref' of the item.
Attributes inherited from Response
#body, #client, #headers, #request_id, #request_time, #status
Instance Method Summary collapse
-
#initialize(faraday_response, client) ⇒ ItemResponse
constructor
Instantiate a new Respose.
Methods inherited from Response
#finished?, #on_complete, #success?
Constructor Details
#initialize(faraday_response, client) ⇒ ItemResponse
Instantiate a new Respose
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 |
Instance Attribute Details
#location ⇒ String (readonly)
Returns The 'Location' of the item.
84 85 86 |
# File 'lib/orchestrate/api/response.rb', line 84 def location @location end |
#ref ⇒ String (readonly)
Returns The canonical 'ref' of the item.
87 88 89 |
# File 'lib/orchestrate/api/response.rb', line 87 def ref @ref end |