Sha256: eb60fe72c4e5e6000bd6d5a493476507873e9a93ef3aa74677e1829cbf6feeb9

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

# Flexmlsapi
require 'rubygems'
require 'curb'
require 'json'
require 'logger'

require File.expand_path('../flexmls_api/version', __FILE__)
require File.expand_path('../flexmls_api/configuration', __FILE__)
require File.expand_path('../flexmls_api/authentication', __FILE__)
require File.expand_path('../flexmls_api/paginate', __FILE__)
require File.expand_path('../flexmls_api/request', __FILE__)
require File.expand_path('../flexmls_api/client', __FILE__)
require File.expand_path('../flexmls_api/faraday', __FILE__)
require File.expand_path('../flexmls_api/primary_array', __FILE__)
require File.expand_path('../flexmls_api/models', __FILE__)

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

  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.4.5 lib/flexmls_api.rb
flexmls_api-0.3.6 lib/flexmls_api.rb