physical 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/physical/box.rb +6 -2
- data/lib/physical/version.rb +1 -1
- 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: 646e84c9b2c88a3fe86df6eb4d4fe6ac79bc4b35
|
4
|
+
data.tar.gz: 67444fccdf92994964181fea9192ddf7d73c3dbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d95659693cf614337735a5e65c72d20a4e7dbabc3f252949f840de4d57e00d79691f4a82cc06f8667c9c4838cbd543b96025f26e1ff6e25b7467f63d092d272e
|
7
|
+
data.tar.gz: 7b9aab3e03d899a33212895ac36abc786e04766542816cf6755232d8b88863c7377e0d1ba1d0c99550eb72ce22a0c89556d866720938178667703f47062c0407
|
data/lib/physical/box.rb
CHANGED
@@ -5,15 +5,19 @@ require 'measured'
|
|
5
5
|
module Physical
|
6
6
|
class Box < Cuboid
|
7
7
|
DEFAULT_LENGTH = BigDecimal::INFINITY
|
8
|
+
DEFAULT_MAX_WEIGHT = BigDecimal::INFINITY
|
9
|
+
|
8
10
|
attr_reader :inner_dimensions,
|
9
11
|
:inner_length,
|
10
12
|
:inner_width,
|
11
|
-
:inner_height
|
13
|
+
:inner_height,
|
14
|
+
:max_weight
|
12
15
|
|
13
|
-
def initialize(inner_dimensions: [], **args)
|
16
|
+
def initialize(inner_dimensions: [], max_weight: Measured::Weight(DEFAULT_MAX_WEIGHT, :g), **args)
|
14
17
|
super args
|
15
18
|
@inner_dimensions = fill_dimensions(Types::Dimensions[inner_dimensions])
|
16
19
|
@inner_length, @inner_width, @inner_height = *@inner_dimensions
|
20
|
+
@max_weight = Types::Weight[max_weight]
|
17
21
|
end
|
18
22
|
|
19
23
|
def inner_volume
|
data/lib/physical/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: physical
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Meyerhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carmen
|