omni_exchange 1.1.0 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71ebf805bee18ff582b11e816572b9bab09208e042c16a00d4c74b933a842104
4
- data.tar.gz: 9decd4210cdcfd4e41a92e59e17f1a1e44addb6618c13db4d0765750d711b6dc
3
+ metadata.gz: 23f8e6cc867244781c587d8ba217e373dabd00c5bf78710b673d8e6f4b330cb0
4
+ data.tar.gz: fffb0e30a3bb6f953ff6a38afcf821023f0e9f898c91448c29e2a6697153bf5d
5
5
  SHA512:
6
- metadata.gz: bd89c93e6e044e0bebb387f369e312760ac782e97da28a12bb0ed635c92696cedb4ea41e3c75cdc7d999d5b69853686a2a71cea6e706c79c263b046e96ff5c55
7
- data.tar.gz: 07ac0fcb122d03643889b01380d97f5dada0ea9b34951b8f88bb7c0a236a82b4244a491ae28f75e82a82c408624606462ebbf3eab08d93f0ea7f73a8e24a85e9
6
+ metadata.gz: a4fe1ff6099ab9d3662f3a4881303e6c3c7d380cfc49c559c09ca39f1a5a918e381fb017c45cb9552e4b7dd35f8c7f52beaa2762898eb84e43e737aa59f7999e
7
+ data.tar.gz: 67d7ae42c4ff478a18669cbbed4ac9c99ac81947402e671e8fec1f072d7e3eeacaf46f18b4570e23b675a7dd34c1ff44b34c051c947aa6a2766e50fc3531755e
data/.gitignore CHANGED
@@ -14,3 +14,6 @@
14
14
  .env
15
15
 
16
16
  sandbox.rb
17
+ omni_exchange-0.1.0.gem
18
+ omni_exchange-0.2.0.gem
19
+ omni_exchange-1.1.0.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omni_exchange (1.1.0)
4
+ omni_exchange (1.1.1)
5
5
  faraday (= 0.17.4)
6
6
  money (~> 6.13.1)
7
7
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OmniExchange
4
- VERSION = '1.1.0'
4
+ VERSION = '1.1.1'
5
5
  end
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.0
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-01 00:00:00.000000000 Z
11
+ date: 2022-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday