metalpriceapi 1.0.1 → 1.0.3
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/README.md +12 -1
- data/lib/metalpriceapi/endpoints/index.rb +9 -1
- data/lib/metalpriceapi/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: d8c1e6efff7bd08dd09c5c1f1cc585d546ab6c523292152d91d78227b8b4c085
|
4
|
+
data.tar.gz: d12dff0e0f85d6193b8b3df4e690d9531c18cde2d6896f6371b6fdb92a33ea04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49f9d63aa68643147a7e6df84bcecc03a3178a72b25984dc7990383f0cca83bc7736b04f642e487a4c1373a9b7b9edb6f78905392866e34cc85b62cac7c8d6b7
|
7
|
+
data.tar.gz: b475816bf8fc52916a16b24b0d06340fd0e82cbda252652064e47c0bfb22bf4af04fabe03770c275e77665dbc72d5ea964a8dd10c0be18fca03907fc28f4e6f1
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# metalpriceapi
|
2
2
|
|
3
|
-
metalpriceapi is the official Ruby wrapper for MetalpriceAPI. This allows you to quickly integrate our API into your application. Check https://metalpriceapi.com documentation for more information.
|
3
|
+
metalpriceapi is the official Ruby wrapper for MetalpriceAPI.com. This allows you to quickly integrate our metal price API and foreign exchange rate API into your application. Check https://metalpriceapi.com documentation for more information.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
Add to Gemfile.
|
@@ -92,6 +92,17 @@ client.change(start_date='2021-04-05', end_date='2021-04-06', base='USD', curren
|
|
92
92
|
```
|
93
93
|
|
94
94
|
[Link](https://metalpriceapi.com/documentation#api_change)
|
95
|
+
---
|
96
|
+
#### carat(start_date, end_date, base, currencies)
|
97
|
+
|
98
|
+
- `base` <[string]> Optional. Pass in a base currency, defaults to USD.
|
99
|
+
- `date` <[string]> Optional. Specify date to get Carat for specific date using format `YYYY-MM-DD`. If not specified, uses live rates.
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
client.carat(base='USD', date='2021-04-06')
|
103
|
+
```
|
104
|
+
|
105
|
+
[Link](https://metalpriceapi.com/documentation#api_carat)
|
95
106
|
|
96
107
|
---
|
97
108
|
**[Official documentation](https://metalpriceapi.com/documentation)**
|
@@ -32,7 +32,7 @@ module MetalpriceAPI
|
|
32
32
|
get('convert', options)
|
33
33
|
end
|
34
34
|
|
35
|
-
def timeframe(start_date
|
35
|
+
def timeframe(start_date, end_date, base = nil, currencies = nil)
|
36
36
|
options = removeEmpty({
|
37
37
|
'start_date': start_date,
|
38
38
|
'end_date': end_date,
|
@@ -52,6 +52,14 @@ module MetalpriceAPI
|
|
52
52
|
get('change', options)
|
53
53
|
end
|
54
54
|
|
55
|
+
def carat(base = '', date = nil)
|
56
|
+
options = removeEmpty({
|
57
|
+
'base': base,
|
58
|
+
'date': date
|
59
|
+
})
|
60
|
+
get('carat', options)
|
61
|
+
end
|
62
|
+
|
55
63
|
private
|
56
64
|
|
57
65
|
def removeEmpty(options)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metalpriceapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MetalpriceAPI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|