boxxer 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 1b7e811efc5e8e1f0174ca7a17f40e2b2d403a423865d8801819a94529b5b516
4
- data.tar.gz: f408183b37c85b424ef44313abdb88e0c8e7be85d8a45387a68df6f35834b471
3
+ metadata.gz: 94b01e461a32482c9e82ac67c445ad8ac0ff220cd2f856e9069136d75bfd2130
4
+ data.tar.gz: 2af80c2e9047c380d85eba1c93827d891b1b8dfffe3cf45974a0151e85179e6a
5
5
  SHA512:
6
- metadata.gz: 76ed9132a602c27ea74124d60af143ce11fcc405942ed7f57078bed334acd2632d4a6191baea34829bbd158c76ebb6c923becca51452a74093c7e617b6f777ea
7
- data.tar.gz: c4f7408c2d0f14f2e684e1a2c26593215fa4f695abe2a7f3ffc37b2fa76e95507b06255d2ac929160833310f6c98310bb77d5c820d2c32cab7960a566aefc4fc
6
+ metadata.gz: 2c4b993a078e6f58cc3b617c03eeb242f7fca5680b78c25e55d663b932b30490df3996753ea6bb29a8d8bc8b1d57c2143efa0a55a3027c8cd1979ad6354d5583
7
+ data.tar.gz: dde510f48b5f93f4655bc42adfdee59fcefa8c430846128d30185dc4eb104c9838e6be7817c68589a6d6a66cb5d1c75e1c4f01a2fd6fa9ec13fc5532b2f2153a
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boxxer (0.1.1)
4
+ boxxer (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -5,7 +5,7 @@ module Boxxer
5
5
  class Error < StandardError; end
6
6
 
7
7
  class Arranger
8
- attr_reader :containers, :container_count, :containers_gross_weight
8
+ attr_reader :containers, :container_count, :total_gross_weight, :total_net_weight
9
9
 
10
10
  def initialize(containers:, weights:)
11
11
  @available_containers = containers.sort { |container| container[:net_limit] }.reverse
@@ -25,10 +25,14 @@ module Boxxer
25
25
 
26
26
  private
27
27
 
28
- def containers_gross_weight
28
+ def total_gross_weight
29
29
  @containers.sum(&:gross_weight)
30
30
  end
31
31
 
32
+ def total_net_weight
33
+ @containers.sum(&:net_weight)
34
+ end
35
+
32
36
  def container_count
33
37
  @containers.count
34
38
  end
@@ -1,6 +1,6 @@
1
1
  module Boxxer
2
2
  class Container
3
- attr_reader :tare_weight, :net_weight, :gross_weight, :weidth, :height, :length
3
+ attr_reader :tare_weight, :net_weight, :gross_weight, :width, :height, :length
4
4
  attr_writer :weights
5
5
 
6
6
  def initialize(width:, height:, length:, tare_weight:, net_limit:)
@@ -1,3 +1,3 @@
1
1
  module Boxxer
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxxer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Sivoglaz