quandl 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bcec9178eedea09db0f199d66775c08a466e626
4
- data.tar.gz: 1f83ce52389cdcf290b7227d683e47ea1a5bbfae
3
+ metadata.gz: aa32c81becaf0be1cfee51e9bbecbacaef44c35a
4
+ data.tar.gz: 99bf163812eeae5a95cba3af9627e93fbd1a94a2
5
5
  SHA512:
6
- metadata.gz: ba3f3b3dc36b8c5608a7d5f274b3b571224966748076b0a3ec8a40937ee7e1bb4387143dc25ecad070ad96669f8d925c5c97c28e03380ba0374078da13a6208e
7
- data.tar.gz: 9b8e317737e4b51d3547a9cc6fdc636f7dc207fa6c6c873742b5ce28720af8c65d0f194662d794b81dee75c33f8349b84ea1a4ab70069def46e430c09b2f7dca
6
+ metadata.gz: d5a9c6b42740c1351f69a779bb4f6a2b681959e1eaef4d8e639da857dd660f30cab767a5eed4d0bef655a3f478a251b3f7775715689fc671697570ea0a2523bf
7
+ data.tar.gz: 11906d6245e1468770493873c00448443529a2b16d02b4c26bdb5628ba4fbbb29a7997395e51cd4442be76ae890b0a5439c9ba5613ffc74172461ea44b77312f
@@ -4,29 +4,42 @@ module Quandl
4
4
  API_BASE_THREAD_KEY = 'quandl_api_base'
5
5
  API_VERSION_THREAD_KEY = 'quandl_api_version_key'
6
6
 
7
+ @api_key = nil
8
+ @api_base = nil
9
+ @api_version = nil
10
+
7
11
  class << self
8
12
  def api_key=(api_key)
13
+ @api_key = api_key if @api_key.nil?
9
14
  Thread.current[API_KEY_THREAD_KEY] = api_key
10
15
  end
11
16
 
12
17
  def api_key
13
- Thread.current[API_KEY_THREAD_KEY]
18
+ Thread.current[API_KEY_THREAD_KEY] || @api_key
14
19
  end
15
20
 
16
21
  def api_base=(api_base)
22
+ @api_base = api_base if @api_base.nil?
17
23
  Thread.current[API_BASE_THREAD_KEY] = api_base
18
24
  end
19
25
 
20
26
  def api_base
21
- Thread.current[API_BASE_THREAD_KEY] || 'https://www.quandl.com/api/v3'
27
+ Thread.current[API_BASE_THREAD_KEY] || @api_base || 'https://www.quandl.com/api/v3'
22
28
  end
23
29
 
24
30
  def api_version=(api_version)
31
+ @api_version = api_base if @api_version.nil?
25
32
  Thread.current[API_VERSION_THREAD_KEY] = api_version
26
33
  end
27
34
 
28
35
  def api_version
29
- Thread.current[API_VERSION_THREAD_KEY]
36
+ Thread.current[API_VERSION_THREAD_KEY] || @api_version
37
+ end
38
+
39
+ def reset
40
+ @api_key = nil
41
+ @api_base = nil
42
+ @api_version = nil
30
43
  end
31
44
  end
32
45
  end
@@ -1,3 +1,3 @@
1
1
  module Quandl
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clement Leung
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-08-26 00:00:00.000000000 Z
12
+ date: 2015-09-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  version: '0'
195
195
  requirements: []
196
196
  rubyforge_project:
197
- rubygems_version: 2.4.5
197
+ rubygems_version: 2.4.8
198
198
  signing_key:
199
199
  specification_version: 4
200
200
  summary: An ORM interface into the quandl api.