weighable 0.10.0 → 0.10.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/lib/weighable/version.rb +1 -1
- data/lib/weighable/weight.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 738914f0c2ec7192f9a3533f0472690aee4a03fc
|
|
4
|
+
data.tar.gz: 8e1cf00aac99a482353637073b5abf004ee82848
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8bbc61d0f965aee9e91533c80f07ada70e7c6188f407dfbb5bb4c9fc10168fedf8bfd0d1feeafca1e35112e03f0ceea7bc6adf27ff3b5de9da7edbab6aa9bf88
|
|
7
|
+
data.tar.gz: ed3838c041512cdf5b220391908ca7ea6a776a5f307265accf517f0af8968b262527e018035a722968bd2dff986cf1d24d8365c621190d916fdfa0fc0d136773
|
data/lib/weighable/version.rb
CHANGED
data/lib/weighable/weight.rb
CHANGED
|
@@ -156,11 +156,11 @@ module Weighable
|
|
|
156
156
|
end
|
|
157
157
|
|
|
158
158
|
def /(other)
|
|
159
|
-
if other.is_a?(Weight)
|
|
159
|
+
if !other.is_a?(Weight) || (other.is_unit? && other.unit != @unit)
|
|
160
|
+
Weight.new(@value / to_math_value(other), unit_name)
|
|
161
|
+
else
|
|
160
162
|
other = other.to(unit_name)
|
|
161
163
|
BigDecimal.new(@value / other.value)
|
|
162
|
-
else
|
|
163
|
-
Weight.new(@value / to_math_value(other), unit_name)
|
|
164
164
|
end
|
|
165
165
|
end
|
|
166
166
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: weighable
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.10.
|
|
4
|
+
version: 0.10.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Trae Robrock
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-01
|
|
11
|
+
date: 2018-02-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|