weighable 0.10.1 → 1.0.0
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 +9 -2
- 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: 9d2ab63e8b1b5d0294a767f2fd252d3f29b45b24
|
4
|
+
data.tar.gz: 73085f79b5364041b48a22a2675e25512a7f034c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f632ed67b21ed745483a3116633c74fa1fd232cbcbf87e1a7c09a09a2ed83222b9ba61ea59f02d95fd16fbc08dd09bac8027caaa1e9b96b0a7a6bb120aaf28c7
|
7
|
+
data.tar.gz: b3189f950f3d2c680d472e5ffdfb5717a651819fc82285162a54974dd11af86ba84ba65343fdaeb1fa50b5079b0ba2bc8bc20c59d885c426d3d93f4b0c15d17f
|
data/lib/weighable/version.rb
CHANGED
data/lib/weighable/weight.rb
CHANGED
@@ -194,8 +194,15 @@ module Weighable
|
|
194
194
|
end
|
195
195
|
|
196
196
|
def round(precision = 0)
|
197
|
-
@value
|
198
|
-
|
197
|
+
Weight.new(@value.round(precision), @unit)
|
198
|
+
end
|
199
|
+
|
200
|
+
def ceil(precision = 0)
|
201
|
+
Weight.new(@value.ceil(precision), @unit)
|
202
|
+
end
|
203
|
+
|
204
|
+
def floor(precision = 0)
|
205
|
+
Weight.new(@value.floor(precision), @unit)
|
199
206
|
end
|
200
207
|
|
201
208
|
def zero?
|
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.
|
4
|
+
version: 1.0.0
|
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-
|
11
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|