Module: Lokalise::Connection

Included in:
Request
Defined in:
lib/ruby-lokalise-api/connection.rb

Constant Summary collapse

BASE_URL =
'https://api.lokalise.com/api2/'

Instance Method Summary collapse

Instance Method Details

#connection(client) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/ruby-lokalise-api/connection.rb', line 7

def connection(client)
  options = {
    headers: {
      accept: 'application/json',
      user_agent: "ruby-lokalise-api gem/#{Lokalise::VERSION}",
      'x-api-token': client.token
    },
    url: BASE_URL
  }
  Faraday.new(options, request_params_for(client)) { |faraday| faraday.adapter Faraday.default_adapter }
end