<commit_before># Sweet Tooth Ruby bindings
# API spec at https://www.sweettoothrewards.com/api/docs
require 'cgi'
require 'set'
require 'openssl'
require 'rest_client'
require 'multi_json'
require 'base64'

# Version
require 'sweettooth/version'

# API operations
require 'sweettooth/api_operations/create'
require 'sweettooth/api_operations/update'
require 'sweettooth/api_operations/delete'
require 'sweettooth/api_operations/list'

# Resources
require 'sweettooth/util'
require 'sweettooth/json'
require 'sweettooth/sweettooth_object'
require 'sweettooth/api_resource'
require 'sweettooth/singleton_api_resource'
require 'sweettooth/collection_object'
require 'sweettooth/activity'
require 'sweettooth/customer'
require 'sweettooth/spending'
require 'sweettooth/spending_option'

# Errors
require 'sweettooth/errors/sweettooth_error'
require 'sweettooth/errors/api_error'
require 'sweettooth/errors/api_connection_error'
require 'sweettooth/errors/invalid_request_error'
require 'sweettooth/errors/authentication_error'

module SweetTooth
  # @api_base = 'https://api.sweettooth.io'
  @api_base = 'http://local-api.sweettooth.io:3000'

  @verify_ssl_certs = true

  class << self
    attr_accessor :api_key, :api_base, :verify_ssl_certs, :api_version
  end

  def self.api_url(url='')
    @api_base + url
  end

  def self.request(method, url, api_key, params={}, headers={})
    unless api_key ||= @api_key
      raise AuthenticationError.new('No API key provided. ' +<commit_msg>Flipped back to production url<commit_after># Sweet Tooth Ruby bindings
# API spec at https://www.sweettoothrewards.com/api/docs
require 'cgi'
require 'set'
require 'openssl'
require 'rest_client'
require 'multi_json'
require 'base64'

# Version
require 'sweettooth/version'

# API operations
require 'sweettooth/api_operations/create'
require 'sweettooth/api_operations/update'
require 'sweettooth/api_operations/delete'
require 'sweettooth/api_operations/list'

# Resources
require 'sweettooth/util'
require 'sweettooth/json'
require 'sweettooth/sweettooth_object'
require 'sweettooth/api_resource'
require 'sweettooth/singleton_api_resource'
require 'sweettooth/collection_object'
require 'sweettooth/activity'
require 'sweettooth/customer'
require 'sweettooth/spending'
require 'sweettooth/spending_option'

# Errors
require 'sweettooth/errors/sweettooth_error'
require 'sweettooth/errors/api_error'
require 'sweettooth/errors/api_connection_error'
require 'sweettooth/errors/invalid_request_error'
require 'sweettooth/errors/authentication_error'

module SweetTooth
  @api_base = 'https://api.sweettooth.io'

  @verify_ssl_certs = true

  class << self
    attr_accessor :api_key, :api_base, :verify_ssl_certs, :api_version
  end

  def self.api_url(url='')
    @api_base + url
  end

  def self.request(method, url, api_key, params={}, headers={})
    unless api_key ||= @api_key
      raise AuthenticationError.new('No API key provided. ' +
{'fraction_non_alphanumeric': 0.10508358921869669, 'fraction_numerical': 0.002729443875810304, 'mean_word_length': 6.257425742574258, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6154499', 'n_tokens_mistral': 1037, 'n_tokens_neox': 969, 'n_words': 204}