weighable 0.6.1 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7ff7faabe8fef92f0beaeb070fc0b614110a7df
4
- data.tar.gz: 5a0212d39f373ffebf1077d1a48ac8473b821372
3
+ metadata.gz: ab98e294f2fca107af47cf5b27c13eb5d1a00ed0
4
+ data.tar.gz: aba32f7c95881c7cf21ae4c8f4b8e498cb83807e
5
5
  SHA512:
6
- metadata.gz: 0cabe4371179b9235cc9832a90e07c0e61d42c9a90cea6aa5ebab8e7dbda2e4387f9bfac6bf31124a055b6b8c1e4370b9ecea1aac7ec7827a09995e5950c203d
7
- data.tar.gz: 5201bab61c76b92bd9f263d49bc87be30a356c2bd2acc8be035d4365b8959c5fd836f10985a5f54b62280e2a27986a651287a541d6a856fee07404ccd03c5f35
6
+ metadata.gz: 22cfb1c699adfd3f7f08cc1b76674b64428420bdc60edc6b285159f6b4ffb0aee8e11647ed0e3bb379498c48ed0f61568de7d4639d92fcadb9546cd9c813bd8b
7
+ data.tar.gz: 8d8190bd122ea598661cf626edc66a6df70819218563523b8842997ad7d694d5397b3b42f3b7585652a1844165e77532fc83ff2b11d7efdb21427d8a307e7132
@@ -1,3 +1,3 @@
1
1
  module Weighable
2
- VERSION = '0.6.1'.freeze
2
+ VERSION = '0.7.0'.freeze
3
3
  end
@@ -22,7 +22,7 @@ module Weighable
22
22
  unit: nil
23
23
  }.freeze
24
24
 
25
- ABBREVATION_ALIASES = {
25
+ ABBREVIATION_ALIASES = {
26
26
  'g' => :gram,
27
27
  'oz' => :ounce,
28
28
  'lb' => :pound,
@@ -88,7 +88,7 @@ module Weighable
88
88
 
89
89
  def self.parse(string)
90
90
  value, unit = string.split(' ')
91
- unit = ABBREVATION_ALIASES[unit]
91
+ unit = ABBREVIATION_ALIASES[unit]
92
92
  fail ArgumentError, 'invalid weight' if unit.nil?
93
93
  Weight.new(value, unit)
94
94
  end
@@ -185,6 +185,10 @@ module Weighable
185
185
  self
186
186
  end
187
187
 
188
+ def zero?
189
+ @value.zero?
190
+ end
191
+
188
192
  private
189
193
 
190
194
  def unit_name
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.6.1
4
+ version: 0.7.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: 2016-06-14 00:00:00.000000000 Z
11
+ date: 2016-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport