forexrateapi 1.0.1 → 1.1.2
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/LICENSE.md +1 -1
- data/README.md +22 -1
- data/lib/forexrateapi/endpoints/index.rb +14 -0
- data/lib/forexrateapi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 487a58e5df23a607de14a2c9cabfbca26c9d209dd570c49b3e31eae96c14f8cf
|
4
|
+
data.tar.gz: 8d3eed1f2488cccd7336a3c91c8fc91a17cc9ec08b75a5900774b9823cac2ea0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83a37021ae5cfca15f6d770abcce5bd6325181e0fd2b5e771c83d0ba038faea124e1a32d2b2bb9fa7aa0b18b70bc00eb2e82a490971d0df29a27e478c85d0d3c
|
7
|
+
data.tar.gz: 59ec9f427a10d0df2631e286226edd40e2bd2f651957fedf1877a23fa992962450ed0249945a732bec0c441ab9c05ac2b7a587e5cfb8e51b8737a7da3e7fd9c3
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -51,6 +51,20 @@ client.fetchHistorical(date='2021-04-05', base='USD', currencies=['AUD', 'CAD',
|
|
51
51
|
|
52
52
|
[Link](https://forexrateapi.com/documentation#api_historical)
|
53
53
|
|
54
|
+
---
|
55
|
+
#### ohlc(base, currency, date, date_type)
|
56
|
+
|
57
|
+
- `base` <[string]> Optional. Pass in a base currency, defaults to USD.
|
58
|
+
- `currency` <[string]> Required. Specify currency you would like to get OHLC for.
|
59
|
+
- `date` <[string]> Required. Specify date to get OHLC for specific date using format `YYYY-MM-DD`.
|
60
|
+
- `date_type` <[string]> Optional. Pass in a date type, overrides date parameter if passed in.
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
client.ohlc(base='USD', currency='EUR', date='2021-04-05', date_type=nil)
|
64
|
+
```
|
65
|
+
|
66
|
+
[Link](https://forexrateapi.com/documentation#api_ohlc)
|
67
|
+
|
54
68
|
---
|
55
69
|
#### convert(from_currency, to_currency, amount, date)
|
56
70
|
|
@@ -94,9 +108,16 @@ client.change(start_date='2021-04-05', end_date='2021-04-06', base='USD', curren
|
|
94
108
|
[Link](https://forexrateapi.com/documentation#api_change)
|
95
109
|
|
96
110
|
---
|
97
|
-
|
111
|
+
#### usage()
|
98
112
|
|
113
|
+
```ruby
|
114
|
+
client.usage()
|
115
|
+
```
|
99
116
|
|
117
|
+
[Link](https://forexrateapi.com/documentation#api_usage)
|
118
|
+
|
119
|
+
---
|
120
|
+
**[Official documentation](https://forexrateapi.com/documentation)**
|
100
121
|
---
|
101
122
|
## FAQ
|
102
123
|
|
@@ -22,6 +22,16 @@ module ForexRateAPI
|
|
22
22
|
get(date, options)
|
23
23
|
end
|
24
24
|
|
25
|
+
def ohlc(base = nil, currency = nil, date = nil, date_type = nil)
|
26
|
+
options = removeEmpty({
|
27
|
+
base: base,
|
28
|
+
currency: currency,
|
29
|
+
date: date,
|
30
|
+
date_type: date_type
|
31
|
+
})
|
32
|
+
get('ohlc', options)
|
33
|
+
end
|
34
|
+
|
25
35
|
def convert(from_currency = nil, to_currency = nil, amount = nil, date = nil)
|
26
36
|
options = removeEmpty({
|
27
37
|
'from': from_currency,
|
@@ -52,6 +62,10 @@ module ForexRateAPI
|
|
52
62
|
get('change', options)
|
53
63
|
end
|
54
64
|
|
65
|
+
def usage
|
66
|
+
get('usage')
|
67
|
+
end
|
68
|
+
|
55
69
|
private
|
56
70
|
|
57
71
|
def removeEmpty(options)
|
data/lib/forexrateapi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forexrateapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ForexRateAPI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|