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 +4 -4
- data/lib/quandl/api_config.rb +16 -3
- data/lib/quandl/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa32c81becaf0be1cfee51e9bbecbacaef44c35a
|
4
|
+
data.tar.gz: 99bf163812eeae5a95cba3af9627e93fbd1a94a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5a9c6b42740c1351f69a779bb4f6a2b681959e1eaef4d8e639da857dd660f30cab767a5eed4d0bef655a3f478a251b3f7775715689fc671697570ea0a2523bf
|
7
|
+
data.tar.gz: 11906d6245e1468770493873c00448443529a2b16d02b4c26bdb5628ba4fbbb29a7997395e51cd4442be76ae890b0a5439c9ba5613ffc74172461ea44b77312f
|
data/lib/quandl/api_config.rb
CHANGED
@@ -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
|
data/lib/quandl/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|