Module: OandaApiV20::Accounts
- Included in:
- Api
- Defined in:
- lib/oanda_api_v20/accounts.rb
Instance Method Summary collapse
-
#account(id) ⇒ Object
GET /v3/accounts/:account_id.
-
#accounts ⇒ Object
GET /v3/accounts.
-
#changes(options = {}) ⇒ Object
GET /v3/accounts/:account_id/changes.
-
#configuration(options = {}) ⇒ Object
PATCH /v3/accounts/:account_id/configuration.
-
#instruments(instruments = nil) ⇒ Object
GET /v3/accounts/:account_id/instruments.
-
#summary ⇒ Object
GET /v3/accounts/:account_id/summary.
Instance Method Details
#account(id) ⇒ Object
GET /v3/accounts/:account_id
5 6 7 |
# File 'lib/oanda_api_v20/accounts.rb', line 5 def account(id) Client.send(http_verb, "#{base_uri}/accounts/#{id}", headers: headers) end |
#accounts ⇒ Object
GET /v3/accounts
10 11 12 |
# File 'lib/oanda_api_v20/accounts.rb', line 10 def accounts Client.send(http_verb, "#{base_uri}/accounts", headers: headers) end |
#changes(options = {}) ⇒ Object
GET /v3/accounts/:account_id/changes
27 28 29 30 |
# File 'lib/oanda_api_v20/accounts.rb', line 27 def changes( = {}) = { 'sinceTransactionID' => nil } unless ['sinceTransactionID'] Client.send(http_verb, "#{base_uri}/accounts/#{account_id}/changes", headers: headers, query: ) end |
#configuration(options = {}) ⇒ Object
PATCH /v3/accounts/:account_id/configuration
33 34 35 |
# File 'lib/oanda_api_v20/accounts.rb', line 33 def configuration( = {}) Client.send(http_verb, "#{base_uri}/accounts/#{account_id}/configuration", headers: headers, body: .to_json) end |
#instruments(instruments = nil) ⇒ Object
GET /v3/accounts/:account_id/instruments
20 21 22 23 24 |
# File 'lib/oanda_api_v20/accounts.rb', line 20 def instruments(instruments = nil) arguments = { headers: headers } arguments.merge!(query: { instruments: instruments }) if instruments Client.send(http_verb, "#{base_uri}/accounts/#{account_id}/instruments", arguments) end |
#summary ⇒ Object
GET /v3/accounts/:account_id/summary
15 16 17 |
# File 'lib/oanda_api_v20/accounts.rb', line 15 def summary Client.send(http_verb, "#{base_uri}/accounts/#{account_id}/summary", headers: headers) end |