metalpriceapi 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0fb6ad53d67350b9d2468f28995cd83f805b4e31e3d77cd38da8313b0a0e67b5
4
- data.tar.gz: 3e102b59f2e0b2a451ebbdd653c0e2f87b8f961ad2e36529d8f6c2d4fb15446e
3
+ metadata.gz: d8c1e6efff7bd08dd09c5c1f1cc585d546ab6c523292152d91d78227b8b4c085
4
+ data.tar.gz: d12dff0e0f85d6193b8b3df4e690d9531c18cde2d6896f6371b6fdb92a33ea04
5
5
  SHA512:
6
- metadata.gz: acc24adf328aace2e7cbbb2add894f6da4a9740fc88fd244fb361dd32f78257a82bf4464eaa1fe1b39996576617b2f83a7c20702b4c1184a8c1690357ffa8a4b
7
- data.tar.gz: b5df98f0b6541ec51cf971e9f0c59eef619051a211c82554dcf39771f0b3ff903796ba3cc66178834414499cbb98ac60072be525f2d6a7d0494a15c87f2ce66f
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 = nil, end_date = nil, base = nil, currencies = nil)
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MetalpriceAPI
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.3'
5
5
  end
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.1
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: 2021-12-25 00:00:00.000000000 Z
11
+ date: 2024-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday