Class: Quandl::Client::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/quandl/client/base.rb,
lib/quandl/client/base/model.rb,
lib/quandl/client/base/search.rb,
lib/quandl/client/base/attributes.rb,
lib/quandl/client/base/validation.rb

Direct Known Subclasses

Dataset, Dataset::Data, Sheet, Source

Defined Under Namespace

Modules: Attributes, Model, Search, Validation Classes: TokenAuthentication

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.tokenObject

Returns the value of attribute token.



15
16
17
# File 'lib/quandl/client/base.rb', line 15

def token
  @token
end

.urlObject

Returns the value of attribute url.



15
16
17
# File 'lib/quandl/client/base.rb', line 15

def url
  @url
end

Class Method Details

.her_apiObject



27
28
29
30
31
32
33
34
# File 'lib/quandl/client/base.rb', line 27

def her_api
  Her::API.new.setup url: url do |c|
    c.use TokenAuthentication
    c.use Faraday::Request::UrlEncoded
    c.use Quandl::Client::Middleware::ParseJSON
    c.use Faraday::Adapter::NetHttp
  end
end

.modelsObject



52
53
54
# File 'lib/quandl/client/base.rb', line 52

def models
  @@models ||= []
end

.models_use_her_api!Object (protected)



58
59
60
# File 'lib/quandl/client/base.rb', line 58

def models_use_her_api!
  models.each{|m| m.use_api( her_api ) }
end

.use(url) ⇒ Object



17
18
19
20
# File 'lib/quandl/client/base.rb', line 17

def use(url)
  self.url = File.join( url, Quandl::Client.api_version )
  models_use_her_api!
end