class TinkoffInvest::V1::Client

Private Instance Methods

base_url() click to toggle source
# File lib/tinkoff_invest/v1/client.rb, line 39
def base_url
  return @url unless @sandbox

  "#{@url}/sandbox"
end
build_connection() click to toggle source
# File lib/tinkoff_invest/v1/client.rb, line 31
def build_connection
  Faraday.new(base_url, headers: connection_headers) do |conn|
    conn.request :json
    conn.response :json, content_type: /\bjson$/
    conn.adapter Faraday.default_adapter
  end
end
connection_headers() click to toggle source
# File lib/tinkoff_invest/v1/client.rb, line 45
def connection_headers
  {
    'Authorization' => "Bearer #{@token}"
  }
end