class Strike::Client

Constants

API_URLS

Set live url, default anything else to test

Attributes

strike_api_env[RW]
strike_api_key[RW]

Public Class Methods

api_url() click to toggle source
# File lib/strike/client.rb, line 32
def api_url
  API_URLS[strike_api_env.to_sym]
end
conn() click to toggle source
# File lib/strike/client.rb, line 21
def conn
  return @conn if @conn

  raise "Please set strike_api_key" if (strike_api_key || "").empty?

  @conn = Faraday.new(url: api_url) do |builder|
    builder.use Faraday::Request::BasicAuthentication, strike_api_key, nil
    builder.use Faraday::Adapter::NetHttp
  end
end
use_environment_variables() click to toggle source
# File lib/strike/client.rb, line 16
def use_environment_variables
  self.strike_api_key = ENV['STRIKE_API_KEY']
  self.strike_api_env = ENV['STRIKE_API_ENV'].downcase
end