Method: IngvQuake::Client#connection

Defined in:
lib/ingv_quake/client.rb

#connectionFaraday::Connection

Initializes a Faraday connection with the INGV Earthquake API base URL and XML headers. Configures the response to be parsed as XML and sets the adapter with optional stubs.

Returns:

  • (Faraday::Connection)

    The Faraday connection instance.

[View source]

40
41
42
43
44
45
# File 'lib/ingv_quake/client.rb', line 40

def connection
  @connection ||= Faraday.new(url: BASE_URL) do |conn|
    conn.response :xml
    conn.adapter adapter, @stubs
  end
end