Method: IngvQuake::Client#connection
- Defined in:
- lib/ingv_quake/client.rb
permalink #connection ⇒ Faraday::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.
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 |