Sha256: aa69a52dbc7e45c9a92f3b42fa8adc8797611054ac0263b3fbbbd2ae8069b2e0

Contents?: true

Size: 1.04 KB

Versions: 12

Compression:

Stored size: 1.04 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/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
  #: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

12 entries across 12 versions & 1 rubygems

Version Path
spark_api-1.3.16 lib/spark_api.rb
spark_api-1.3.15 lib/spark_api.rb
spark_api-1.3.14 lib/spark_api.rb
spark_api-1.3.13 lib/spark_api.rb
spark_api-1.3.10 lib/spark_api.rb
spark_api-1.3.9 lib/spark_api.rb
spark_api-1.3.6 lib/spark_api.rb
spark_api-1.3.3 lib/spark_api.rb
spark_api-1.3.1 lib/spark_api.rb
spark_api-1.3.0 lib/spark_api.rb
spark_api-1.2.1 lib/spark_api.rb
spark_api-1.2.0 lib/spark_api.rb