Class: Intrinio::API
- Inherits:
-
APICake::Base
- Object
- APICake::Base
- Intrinio::API
- Defined in:
- lib/intrinio/api.rb
Overview
Provides access to all the Intrinio API endpoints with dynamic methods anc caching.
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #default_params ⇒ Object
-
#initialize(opts = {}) ⇒ API
constructor
A new instance of API.
Constructor Details
#initialize(opts = {}) ⇒ API
Returns a new instance of API.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/intrinio/api.rb', line 11 def initialize(opts={}) if opts[:auth] opts[:username], opts[:password] = opts[:auth].split ':' opts.delete :auth end @username, @password = opts[:username], opts[:password] cache.disable unless opts[:use_cache] cache.dir = opts[:cache_dir] if opts[:cache_dir] cache.life = opts[:cache_life] if opts[:cache_life] end |
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
9 10 11 |
# File 'lib/intrinio/api.rb', line 9 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
9 10 11 |
# File 'lib/intrinio/api.rb', line 9 def username @username end |
Instance Method Details
#default_params ⇒ Object
24 25 26 |
# File 'lib/intrinio/api.rb', line 24 def default_params { basic_auth: { username: username, password: password } } end |