Class: Quovo::Api::Base
- Inherits:
-
Object
- Object
- Quovo::Api::Base
- Defined in:
- lib/quovo/api/base.rb
Direct Known Subclasses
Accounts, Brokerages, Challenges, Extras, History, IframeToken, Portfolios, Positions, Users, Webhooks
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #api(method, path, params = {}) ⇒ Object
-
#initialize(token = Quovo::Token.new) ⇒ Base
constructor
A new instance of Base.
Methods included from Request
Constructor Details
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
24 25 26 |
# File 'lib/quovo/api/base.rb', line 24 def token @token end |
Instance Method Details
#api(method, path, params = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/quovo/api/base.rb', line 11 def api(method, path, params = {}) format = case method when :delete :plain else :json end request(method, path, params, format) do |req| req['Authorization'] = "Bearer #{token.get}" end || {} end |