app/models/user.rb
# Faraday connection to gamebus with authorization setup
Faraday connection to gamebus with authorization setup
Faraday connection to gamebus with authorization setup
def gamebus_connection
    connection = Faraday.new url: Rails.application.secrets.gamebus_url do |faraday|
      faraday.request  :url_encoded                                              
      faraday.response :logger if Rails.env.development? || ENV['DEBUG_FARADAY'] 
      faraday.adapter  Faraday.default_adapter                                   
    end
    connection.headers['Authorization'] = "Bearer #{gamebus_key}"
    connection.headers['Content-Type'] = 'application/json'
    return connection
  end
def gamebus_connection connection = Faraday . new url : Rails . application . secrets . gamebus_url do | faraday | faraday . request :url_encoded faraday . response :logger if Rails . env . development? || ENV [ 'DEBUG_FARADAY' ] faraday . adapter Faraday . default_adapter end connection . headers [ 'Authorization' ] = "Bearer #{gamebus_key}" connection . headers [ 'Content-Type' ] = 'application/json' return connection end
Faraday connection to gamebus with authorization setup
Faraday connection to gamebus with authorization setup
# form-encode POST params # log requests to STDOUT # make requests with Net::HTTP