monies 2.0.0 → 2.0.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 +4 -4
- data/CHANGES.md +4 -0
- data/lib/monies.rb +3 -3
- data/monies.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e73004f07c8e1c7283fdf9ec47bd835bfdb6f31f8972a17bc1d2a6b4e46b80da
|
|
4
|
+
data.tar.gz: 074521143df07c2869bec2fdc6c7f3802dae47967deb945aa1ca861fdd0ef181
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 002bf11aa07e6177a1ffca11e958084fedda081ccec63c8bd329f862c69ab84dccbf2e421ed584daaadd2c5eaf56bc236b43f27e8e448764ef2e1517fdf02129
|
|
7
|
+
data.tar.gz: b02008bbfc99adf200770f3c3ba47c9f0f60abd03e64dd856561998863fca40ab0b96947581c0b6f20c9dd94a1791e60bd2c35d218c34981ab3af64af37963b6
|
data/CHANGES.md
CHANGED
data/lib/monies.rb
CHANGED
|
@@ -217,11 +217,11 @@ class Monies
|
|
|
217
217
|
end
|
|
218
218
|
|
|
219
219
|
def coerce(other)
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
if other.respond_to?(:zero?) && other.zero?
|
|
221
|
+
return self.class.new(0, 0, @currency), self
|
|
222
222
|
end
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
raise TypeError, "#{self.class} can't be coerced into #{other.class}"
|
|
225
225
|
end
|
|
226
226
|
|
|
227
227
|
def convert(other, currency = nil)
|
data/monies.gemspec
CHANGED