Sha256: 1389b0ffc61bc2c014d81a479679f32bc3f593903da45cdc3d223846db8a02c7

Contents?: true

Size: 765 Bytes

Versions: 5

Compression:

Stored size: 765 Bytes

Contents

module Quandl
  class ApiConfig
    API_KEY_THREAD_KEY = 'quandl_api_key'
    API_BASE_THREAD_KEY = 'quandl_api_base'
    API_VERSION_THREAD_KEY = 'quandl_api_version_key'

    class << self
      def api_key=(api_key)
        Thread.current[API_KEY_THREAD_KEY] = api_key
      end

      def api_key
        Thread.current[API_KEY_THREAD_KEY]
      end

      def api_base=(api_base)
        Thread.current[API_BASE_THREAD_KEY] = api_base
      end

      def api_base
        Thread.current[API_BASE_THREAD_KEY] || 'https://www.quandl.com/api/v3'
      end

      def api_version=(api_version)
        Thread.current[API_VERSION_THREAD_KEY] = api_version
      end

      def api_version
        Thread.current[API_VERSION_THREAD_KEY]
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
quandl-1.0.2 lib/quandl/api_config.rb
quandl-1.0.1 lib/quandl/api_config.rb
quandl-1.0.0 lib/quandl/api_config.rb
quandl-1.0.0.rc2 lib/quandl/api_config.rb
quandl-1.0.0.rc1 lib/quandl/api_config.rb