oanda_api_v20 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5cc17a87a05a5669e9e354172d5ce22e499a55ad
4
- data.tar.gz: 46e88f60cbf5afc6b1a68d1879606f314705dc0c
3
+ metadata.gz: b8108f8ae8240196afbf5ce81fb7cc96f9eeece1
4
+ data.tar.gz: 97384a79da9a3a293529034eb5f2a483c5c9b96e
5
5
  SHA512:
6
- metadata.gz: 9a0a165e36940c48f27d404e0410653b31a93f310167500262a50dc27863a7958608d64273c6053b85391397af791e8d2d1a3041e24713f63b6a27e4c44a3d5a
7
- data.tar.gz: c73dbae14c7268667aefea57b112b18274ff4447c46bf8fde9f4225d089f047a2bf1632a00fec4b2dd764f49034874e0ea825e2d27b60256a88f89fac21102bd
6
+ metadata.gz: def31bfcd6716e880495a6396133334fd649c9fa64f42c1b957b4a165bb7b3b3ea74e13be95b3293ababb1f754ad935bd09ab24360ee9a58008e646bd61279f7
7
+ data.tar.gz: 6ee7cb2047dd8e05eae5da2da3efd859a6dfad1fd1c4f989342b73a9a67e6bd43d8b6145991e1c73ab0c82e6d61a7e94a2ae7679d049af52e0a4a6855c496c1a
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.5.0
4
+ #### 2017-07-07
5
+ * Updated the orders method to allow query options to be passed along.
6
+
3
7
  ## 1.4.0
4
8
  #### 2017-06-04
5
9
  * Ability for API requests to go through a proxy.
data/README.md CHANGED
@@ -70,7 +70,7 @@ client.account('account_id').changes.show
70
70
  ```ruby
71
71
  options = { 'sinceTransactionID' => '6358' }
72
72
 
73
- client.account('account_id').changes.show
73
+ client.account('account_id').changes(options).show
74
74
  ```
75
75
 
76
76
  ```ruby
@@ -97,6 +97,12 @@ See the [Oanda Documentation](http://developer.oanda.com/rest-live-v20/order-ep/
97
97
  client.account('account_id').orders.show
98
98
  ```
99
99
 
100
+ ```ruby
101
+ options = { 'instrument' => 'USD_CAD' }
102
+
103
+ client.account('account_id').orders(options).show
104
+ ```
105
+
100
106
  ```ruby
101
107
  id = client.account('account_id').orders.show['orders'][0]['id']
102
108
 
@@ -18,8 +18,8 @@ module OandaApiV20
18
18
  end
19
19
 
20
20
  # GET /v3/accounts/:account_id/orders
21
- def orders
22
- Client.send(http_verb, "#{base_uri}/accounts/#{account_id}/orders", headers: headers)
21
+ def orders(options = {})
22
+ Client.send(http_verb, "#{base_uri}/accounts/#{account_id}/orders", headers: headers, query: options)
23
23
  end
24
24
 
25
25
  # GET /v3/accounts/:account_id/pendingOrders
@@ -1,3 +1,3 @@
1
1
  module OandaApiV20
2
- VERSION = '1.4.0'
2
+ VERSION = '1.5.0'
3
3
  end
@@ -174,6 +174,12 @@ describe OandaApiV20::Api do
174
174
  expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders')).to have_been_made.once
175
175
  end
176
176
 
177
+ it 'retrieving all orders' do
178
+ options = { 'instrument' => 'USD_CAD' }
179
+ api.orders(options)
180
+ expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/orders').with(query: options)).to have_been_made.once
181
+ end
182
+
177
183
  it 'retrieving all pending orders' do
178
184
  api.pending_orders
179
185
  expect(a_request(:get, 'https://api-fxtrade.oanda.com/v3/accounts/100-100-100/pendingOrders')).to have_been_made.once
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oanda_api_v20
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kobus Joubert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-04 00:00:00.000000000 Z
11
+ date: 2017-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty