haversack 0.1.0 → 0.2.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
  SHA256:
3
- metadata.gz: 6cd0e17b216a5749f67cfa35838d739f4d45971dbb87b6a145cba0a41f4e9b2e
4
- data.tar.gz: 727df279fe818360a8533f698700d218d3801f4939052d719fe252aa2a7dd9ba
3
+ metadata.gz: d71edcac6f25267e658d600c14549b4be32fe255a2bfcbf00a2c8c73e8d7a3c6
4
+ data.tar.gz: e895b3122a414660d8fbf52a1d64c8e0b08c920bb13bef8ce63168fd483499e5
5
5
  SHA512:
6
- metadata.gz: de5429d256326f523cf432ff334944318900104477b0dba9b93bcd5079e16e1bc615e8ab10d29d6cd498c85c05482c60597948a8abe2cb3cbca3d092f3849b7e
7
- data.tar.gz: 443d15a96241f0b4bb73e70653f46b1a45f3207d924bfff57e2a6014603598dc380c7acfce4dc66557ba73c5b450622ea085e6aacf55bd550120729800917c3a
6
+ metadata.gz: ea48edcbbd0f07b31b119fec4000d8c596a85368b02ff37e2f9832279e14a5eef5be49bc2ea04e314dfd1a8b5e5a1674e0c79c3c5865b9b6a253ed7973676a1c
7
+ data.tar.gz: 6a910b9216773f852aedacae2a96d0aa11d4997de9a8665374c024db50811a2c7dd6d1171c2d683c273f244aac2f16570cbc92a441a3a17d09d33002f8d43c15
@@ -45,12 +45,12 @@ class Sack
45
45
  item.size < @available_capacity
46
46
  end
47
47
 
48
- def will_fit?(item)
48
+ def fits_item?(item)
49
49
  (item.is_a? Haversack::Item) && (fits_item_capacity?(item) && fits_item_weight?(item))
50
50
  end
51
51
 
52
- def push(item) ## TODO: This should return an error that describes which constraint failed
53
- will_fit? item ? @contents.push(item) : raise(Haversack::KnapsackContentError)
52
+ def push(item) ## TODO: Return an error that describes which constraint failed
53
+ fits_item? item ? @contents.push(item) : raise(Haversack::KnapsackContentError)
54
54
  @contents
55
55
  end
56
56
 
@@ -1,3 +1,3 @@
1
1
  module Haversack
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haversack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - alex0112