active_currency 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_currency/add_rates.rb +6 -2
- data/lib/active_currency/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56f6adecbe4588cdec72671119078133df0cb4bc
|
4
|
+
data.tar.gz: 03425c4a136c196d0776d8160e8a7b9c0c4c66e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fde85398d3c49aa68f1ed012025f443bc47a43ef5ed513670c4ce679ba4eec9c1aa460e256d1ac4125b69fb6fe8f5412536601828f5257bbc1b897933ecc7688
|
7
|
+
data.tar.gz: 566f5c432f78da8151db7d5ed9ed81e83c1e6cdba28999f42a15eed930fc750f21606d9b77a8e8982b54f81ec7369cc7ff91c54c3709cc7375ce706933f8fc64
|
@@ -16,8 +16,8 @@ module ActiveCurrency
|
|
16
16
|
next if to == from
|
17
17
|
|
18
18
|
rate = bank.get_rate(from, to)
|
19
|
-
|
20
|
-
|
19
|
+
store.add_rate(from, to, rate)
|
20
|
+
store.add_rate(to, from, 1 / rate)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
@@ -26,5 +26,9 @@ module ActiveCurrency
|
|
26
26
|
def currencies
|
27
27
|
@currencies.map(&:to_s).map(&:upcase)
|
28
28
|
end
|
29
|
+
|
30
|
+
def store
|
31
|
+
@store ||= ActiveCurrency::RateStore.new
|
32
|
+
end
|
29
33
|
end
|
30
34
|
end
|