omni_exchange 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/Gemfile.lock +1 -1
- data/lib/omni_exchange/providers/open_exchange_rates.rb +2 -2
- data/lib/omni_exchange/version.rb +1 -1
- data/lib/omni_exchange.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: 23f8e6cc867244781c587d8ba217e373dabd00c5bf78710b673d8e6f4b330cb0
|
4
|
+
data.tar.gz: fffb0e30a3bb6f953ff6a38afcf821023f0e9f898c91448c29e2a6697153bf5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4fe1ff6099ab9d3662f3a4881303e6c3c7d380cfc49c559c09ca39f1a5a918e381fb017c45cb9552e4b7dd35f8c7f52beaa2762898eb84e43e737aa59f7999e
|
7
|
+
data.tar.gz: 67d7ae42c4ff478a18669cbbed4ac9c99ac81947402e671e8fec1f072d7e3eeacaf46f18b4570e23b675a7dd34c1ff44b34c051c947aa6a2766e50fc3531755e
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -33,9 +33,9 @@ module OmniExchange
|
|
33
33
|
|
34
34
|
exchange_rate = JSON.parse(response.body, symbolize_names: true)[:rates][target_currency.to_sym].to_d
|
35
35
|
|
36
|
-
currency_unit = get_currency_unit(base_currency)
|
36
|
+
currency_unit = get_currency_unit(base_currency).to_d
|
37
37
|
|
38
|
-
exchange_rate * currency_unit
|
38
|
+
(exchange_rate * currency_unit).to_d
|
39
39
|
end
|
40
40
|
|
41
41
|
# when this file is required at the top of lib/omni_exchange.rb, this method call is run and allows
|
data/lib/omni_exchange.rb
CHANGED
@@ -71,7 +71,7 @@ module OmniExchange
|
|
71
71
|
provider_classes.each do |klass|
|
72
72
|
rate = klass.get_exchange_rate(base_currency: base_currency, target_currency: target_currency)
|
73
73
|
|
74
|
-
exchanged_amount = rate * amount.to_d
|
74
|
+
exchanged_amount = rate.to_d * amount.to_d
|
75
75
|
|
76
76
|
return { converted_amount: exchanged_amount, exchange_rate: rate, provider_class: klass }
|
77
77
|
rescue Faraday::Error, Faraday::ConnectionFailed => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omni_exchange
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yun Chung
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|