Class: FixerApiClient::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/fixer_api_client/connection.rb

Class Method Summary collapse

Class Method Details

.connectionObject



8
9
10
11
12
13
14
# File 'lib/fixer_api_client/connection.rb', line 8

def self.connection
  ::Faraday.new(url: url) do |conn|
    conn.request :json
    conn.adapter :net_http
    conn.response :json, content_type: /\bjson$/
  end
end

.urlObject



16
17
18
# File 'lib/fixer_api_client/connection.rb', line 16

def self.url
  ENV['FIXER_IO_API_URL'] || 'http://data.fixer.io/api'
end