boxxer 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 704b41b95d02827f07d78de7ce6a5937bd99b4fa2cffdf3c163222ab7f5c230c
4
- data.tar.gz: 91d5b7481ff8b9b1240811c31fa645ba1e841f99389f456d2092f20f44d2bae1
3
+ metadata.gz: 1b7e811efc5e8e1f0174ca7a17f40e2b2d403a423865d8801819a94529b5b516
4
+ data.tar.gz: f408183b37c85b424ef44313abdb88e0c8e7be85d8a45387a68df6f35834b471
5
5
  SHA512:
6
- metadata.gz: ff6ee3c75dbffd1574ece0d78236d6832627342bdbd2790a4957e81abf2fadb0d886ce637aa339716037d67aea15dba1a1354f24572be6aab51d02f1542a3586
7
- data.tar.gz: 37edf969362276facce8ad5d4918524c4d0549c33a43b0fece0b0319d7ad7ffc972f79c493b7d2d28a8e52334815937b8774c8d8d785e7ec226fd4e50b9d981f
6
+ metadata.gz: 76ed9132a602c27ea74124d60af143ce11fcc405942ed7f57078bed334acd2632d4a6191baea34829bbd158c76ebb6c923becca51452a74093c7e617b6f777ea
7
+ data.tar.gz: c4f7408c2d0f14f2e684e1a2c26593215fa4f695abe2a7f3ffc37b2fa76e95507b06255d2ac929160833310f6c98310bb77d5c820d2c32cab7960a566aefc4fc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- boxxer (0.1.0)
4
+ boxxer (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -5,6 +5,12 @@ This gem intended to pick containers(boxes, packages, cartons), based on item we
5
5
  ## Usage
6
6
 
7
7
  ```
8
+ gem install boxxer
9
+ irb
10
+ ```
11
+
12
+ ```
13
+ require 'boxxer'
8
14
  weights = []
9
15
  20.times { weights << rand(0.5..1).round(3) }
10
16
  containers = [{ length: 47, width: 38, height: 10, tare_weight: 0.019, net_limit: 0.481 },
@@ -5,7 +5,7 @@ module Boxxer
5
5
  class Error < StandardError; end
6
6
 
7
7
  class Arranger
8
- attr_reader :containers, :container_count
8
+ attr_reader :containers, :container_count, :containers_gross_weight
9
9
 
10
10
  def initialize(containers:, weights:)
11
11
  @available_containers = containers.sort { |container| container[:net_limit] }.reverse
@@ -25,6 +25,10 @@ module Boxxer
25
25
 
26
26
  private
27
27
 
28
+ def containers_gross_weight
29
+ @containers.sum(&:gross_weight)
30
+ end
31
+
28
32
  def container_count
29
33
  @containers.count
30
34
  end
@@ -1,6 +1,6 @@
1
1
  module Boxxer
2
2
  class Container
3
- attr_reader :dimensions, :tare_weight, :net_weight, :gross_weight
3
+ attr_reader :tare_weight, :net_weight, :gross_weight, :weidth, :height, :length
4
4
  attr_writer :weights
5
5
 
6
6
  def initialize(width:, height:, length:, tare_weight:, net_limit:)
@@ -12,10 +12,6 @@ module Boxxer
12
12
  @weights = []
13
13
  end
14
14
 
15
- def dimensions
16
- { width: width, height: height, length: length }
17
- end
18
-
19
15
  def net_weight
20
16
  (@weights.sum).truncate(3)
21
17
  end
@@ -1,3 +1,3 @@
1
1
  module Boxxer
2
- VERSION = "0.1.0"
2
+ VERSION = '0.1.1'
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Sivoglaz