Sha256: b3779656952edfce472c43e219d2045127f314dc0c8fe7036947e9b1399d8358

Contents?: true

Size: 984 Bytes

Versions: 3

Compression:

Stored size: 984 Bytes

Contents

require 'rubygems'
require 'json'
require 'logger'

require 'spark_api/version'
require 'spark_api/configuration'
require 'spark_api/multi_client'
require 'spark_api/authentication'
require 'spark_api/response'
require 'spark_api/paginate'
require 'spark_api/request'
require 'spark_api/connection'
require 'spark_api/client'
require 'spark_api/faraday'
require 'spark_api/primary_array'
require 'spark_api/models'

module SparkApi
  extend Configuration
  extend MultiClient
 
  #:nocov:
  def self.logger
    if @logger.nil?
      @logger = Logger.new(STDOUT)
      @logger.level = Logger::INFO
    end
    @logger
  end
  #:nocov:

  def self.client(opts={})
    Thread.current[:spark_api_client] ||= SparkApi::Client.new(opts)
  end

  def self.method_missing(method, *args, &block)
    return super unless (client.respond_to?(method))
    client.send(method, *args, &block)
  end
  
  def self.reset
    reset_configuration
    Thread.current[:spark_api_client] = nil
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spark_api-1.0.2 lib/spark_api.rb
spark_api-1.0.1 lib/spark_api.rb
spark_api-1.0.0 lib/spark_api.rb