Sha256: 56362d5c0fe391431573458db24119a36fa3873112c1e901fd9e5b4bfe919033

Contents?: true

Size: 1.13 KB

Versions: 20

Compression:

Stored size: 1.13 KB

Contents

require 'rubygems'
require 'logger'
require 'multi_json'

require 'spark_api/version'
require 'spark_api/errors'
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_middleware'
require 'spark_api/reso_faraday_middleware'
require 'spark_api/primary_array'
require 'spark_api/options_hash'
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

  def self.logger= logger
    @logger = 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

20 entries across 20 versions & 1 rubygems

Version Path
spark_api-1.5.1 lib/spark_api.rb
spark_api-1.5.0 lib/spark_api.rb
spark_api-1.4.34 lib/spark_api.rb
spark_api-1.4.32 lib/spark_api.rb
spark_api-1.4.31 lib/spark_api.rb
spark_api-1.4.29 lib/spark_api.rb
spark_api-1.4.28 lib/spark_api.rb
spark_api-1.4.27 lib/spark_api.rb
spark_api-1.4.26 lib/spark_api.rb
spark_api-1.4.25 lib/spark_api.rb
spark_api-1.4.24 lib/spark_api.rb
spark_api-1.4.23 lib/spark_api.rb
spark_api-1.4.22 lib/spark_api.rb
spark_api-1.4.21 lib/spark_api.rb
spark_api-1.4.20 lib/spark_api.rb
spark_api-1.4.19 lib/spark_api.rb
spark_api-1.4.18 lib/spark_api.rb
spark_api-1.4.17 lib/spark_api.rb
spark_api-1.4.16 lib/spark_api.rb
spark_api-1.4.15 lib/spark_api.rb