Class: Linzer::Message::Adapter::Faraday::Response

Inherits:
Generic::Response show all
Defined in:
lib/linzer/message/adapter/faraday/response.rb

Overview

Note:

Not loaded automatically to avoid making faraday a hard dependency. Require “linzer/faraday” to register this adapter.

Adapter for Faraday::Response objects from the faraday gem.

Extends the generic response adapter with faraday-specific derived component retrieval (e.g. @status) and header attachment.

Instance Method Summary collapse

Methods inherited from Generic::Response

#header, #initialize

Methods inherited from Abstract

#[], #attached_request?, #field?, #header, #initialize, #request?, #response?

Constructor Details

This class inherits a constructor from Linzer::Message::Adapter::Generic::Response

Instance Method Details

#attach!(signature) ⇒ ::Faraday::Response

Attaches a signature to the underlying response headers.

Parameters:

Returns:

  • (::Faraday::Response)

    the underlying response object



23
24
25
26
# File 'lib/linzer/message/adapter/faraday/response.rb', line 23

def attach!(signature)
  signature.to_h.each { |h, v| @operation.headers[h] = v }
  @operation
end