Sha256: 53a8cd32572c376cafdb0353dbe2101e0d3cd17ef6ea2c211d3b669ee4017aaa

Contents?: true

Size: 1016 Bytes

Versions: 2

Compression:

Stored size: 1016 Bytes

Contents

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

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

module FlexmlsApi
  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[:flexmls_api_client] ||= FlexmlsApi::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[:flexmls_api_client] = nil
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flexmls_api-0.7.3 lib/flexmls_api.rb
flexmls_api-0.7.5 lib/flexmls_api.rb