Module: Quandl::Client
- Defined in:
- lib/quandl/client.rb,
lib/quandl/client/her.rb,
lib/quandl/client/models.rb,
lib/quandl/client/version.rb,
lib/quandl/client/models/sheet.rb,
lib/quandl/client/models/source.rb,
lib/quandl/client/models/dataset.rb,
lib/quandl/client/models/dataset/properties.rb,
lib/quandl/client/models/dataset/searchable.rb
Defined Under Namespace
Modules: Models
Classes: Dataset, Parser, Sheet, Source, TokenAuthentication
Constant Summary
collapse
- VERSION =
'0.0.3'
- API_VERSION =
'v1'
Class Method Summary
collapse
Class Method Details
.api_version ⇒ Object
8
9
10
|
# File 'lib/quandl/client/version.rb', line 8
def api_version
API_VERSION
end
|
.her_api ⇒ Object
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/quandl/client/her.rb', line 17
def her_api
api = Her::API.new
api.setup url: rest_url do |c|
c.use TokenAuthentication
c.use Faraday::Request::UrlEncoded
c.use Parser
c.use Faraday::Adapter::NetHttp
end
end
|
.reload_models ⇒ Object
40
41
42
|
# File 'lib/quandl/client/her.rb', line 40
def reload_models
Models.use_api( her_api )
end
|
.rest_url ⇒ Object
28
29
30
|
# File 'lib/quandl/client/her.rb', line 28
def rest_url
@rest_url ||= 'http://www.quandl.com/api/'
end
|
.rest_url=(url) ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/quandl/client/her.rb', line 32
def rest_url=(url)
url = "http://#{url}" if ( url =~ /^http:\/\// ) == nil
url = File.join(url, "#{API_VERSION}/")
@rest_url = url
reload_models
@rest_url
end
|
.token ⇒ Object
9
10
11
|
# File 'lib/quandl/client/her.rb', line 9
def token
@token
end
|
.token=(token) ⇒ Object
12
13
14
15
|
# File 'lib/quandl/client/her.rb', line 12
def token=(token)
@token = token
reload_models
end
|
.use(url) ⇒ Object
5
6
7
|
# File 'lib/quandl/client/her.rb', line 5
def use(url)
self.rest_url = url
end
|