oanda_api_v20 0.0.5 → 0.0.6
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -0
- data/lib/oanda_api_v20.rb +2 -0
- data/lib/oanda_api_v20/client.rb +9 -1
- data/lib/oanda_api_v20/exceptions.rb +3 -0
- data/lib/oanda_api_v20/version.rb +1 -1
- data/oanda_api_v20.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df006567cbd1acee31c44649ff9660bae3cbd8ca
|
4
|
+
data.tar.gz: cbc54442151b3a3cb06fd4044812a56fc23ed52a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc14f293e67e1b0351044dd1f50621d248b633c9d254ae9a4f0d5a6bff990b381560370c497409117a01f1da1524b077afb30453b4e6f492087f3677a6b32d09
|
7
|
+
data.tar.gz: 5c82460ae6765964e0f23d93d4b6176d848cb6fce9a07d143371c1e132329d631a2a76f4102022b5a26f052b5259c675fad98abeb1fd3bfb94c6475d7b85e600
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -252,6 +252,10 @@ options = {
|
|
252
252
|
client.account('account_id').pricing(options).show
|
253
253
|
```
|
254
254
|
|
255
|
+
## Exceptions
|
256
|
+
|
257
|
+
A `OandaApiV20::RequestError` will be raised when a request to the Oanda API failed for any reason.
|
258
|
+
|
255
259
|
## Contributing
|
256
260
|
|
257
261
|
1. Fork it
|
data/lib/oanda_api_v20.rb
CHANGED
data/lib/oanda_api_v20/client.rb
CHANGED
@@ -46,7 +46,15 @@ module OandaApiV20
|
|
46
46
|
if api.respond_to?(last_action)
|
47
47
|
set_last_api_request_at
|
48
48
|
govern_api_request_rate
|
49
|
-
|
49
|
+
|
50
|
+
begin
|
51
|
+
response = Http::Exceptions.wrap_exception do
|
52
|
+
last_arguments.nil? || last_arguments.empty? ? api.send(last_action, &block) : api.send(last_action, *last_arguments, &block)
|
53
|
+
end
|
54
|
+
rescue Http::Exceptions::HttpException => e
|
55
|
+
raise OandaApiV20::RequestError, e.message
|
56
|
+
end
|
57
|
+
|
50
58
|
api_result = JSON.parse(response.body)
|
51
59
|
set_last_transaction_id(api_result)
|
52
60
|
end
|
data/oanda_api_v20.gemspec
CHANGED
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: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kobus Joubert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: http-exceptions
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.1'
|
41
55
|
description: Ruby client that supports the Oanda REST API V20 methods.
|
42
56
|
email: kobus@translate3d.com
|
43
57
|
executables: []
|
@@ -53,6 +67,7 @@ files:
|
|
53
67
|
- lib/oanda_api_v20/accounts.rb
|
54
68
|
- lib/oanda_api_v20/api.rb
|
55
69
|
- lib/oanda_api_v20/client.rb
|
70
|
+
- lib/oanda_api_v20/exceptions.rb
|
56
71
|
- lib/oanda_api_v20/oanda_api_v20.rb
|
57
72
|
- lib/oanda_api_v20/orders.rb
|
58
73
|
- lib/oanda_api_v20/positions.rb
|