Method: Brine::ClientBuilding#client_for_host

Defined in:
lib/brine/client_building.rb

#client_for_host(host, logging: ) ⇒ Faraday::Connection

Return a client which will send requests to ‘host`.

This will configure the client using ‘#connection_handlers`.

Parameters:

  • host (String)

    Specify the hostname to which this client will send requests.

  • logging (String) (defaults to: )

    Indicate the desired logging level for this client.

Returns:

  • (Faraday::Connection)

    Return the configured client connection.

[View source]

109
110
111
112
113
114
# File 'lib/brine/client_building.rb', line 109

def client_for_host(host, logging: ENV['BRINE_LOG_HTTP'])
  @logging = logging
  Faraday.new(host) do |conn|
    connection_handlers.each{|h| h.call(conn) }
  end
end