active_cabinet 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0e758ab665623b4914ee47333fc31eed359da51fe9b1739c221fec4ed76a5c7
4
- data.tar.gz: 4c41f042136643bc66014e4c55b7276c8cdeb1ecffebbe021ab34b9ea70e8d61
3
+ metadata.gz: 8dd6fedc3ca5771467baee667ae128cf77f2042394e28169057c3707205391fc
4
+ data.tar.gz: c89be55b4d4d6d4bbebe6a6044fd24145027454716c4118da2b8c57e75acca9e
5
5
  SHA512:
6
- metadata.gz: e294347a1f3dfa3148c93220734eaacb8d800a42a53f0c1cf15e6e5c41628cb643d087672c7a29944a1364bdd5aaec6bed7b9f1e612f70ffd93322643672600a
7
- data.tar.gz: '0492f1da68709b7c72a8f329b049fa53a24a2ae44639d34594cc72471ae9df478a3713574a0980bcbfc4b8672a765cdcb5714b1b65c1b18c44aa2375a3f4ae4a'
6
+ metadata.gz: 5cdcf93a07fc0ff445812239c21f5602eb10ce014a242359351bc1d5bb5109964ebaf6a9975891ea090a5efa639c516d14c078ea24c44920664d444308be1f2b
7
+ data.tar.gz: 2bc8d3fcac688ea0b0625ea28787b3f7d39222e943ae5f0aa1e4887e40fa8899b079fe743536280488313fcdf5c19d961c05ebb8bd6bf0d163ae643174cebc58
@@ -152,6 +152,14 @@ class ActiveCabinet
152
152
  !!cabinet.delete(id)
153
153
  end
154
154
 
155
+ # Deletes a record for which the block returns true.
156
+ #
157
+ # @example Delete records using a block
158
+ # Song.delete_if { |record| record[:artist] == "Iron Maiden" }
159
+ def delete_if
160
+ cabinet.delete_if { |key, _value| yield self[key] }
161
+ end
162
+
155
163
  # Deletes all records.
156
164
  def drop
157
165
  cabinet.clear
@@ -1,3 +1,3 @@
1
1
  class ActiveCabinet
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_cabinet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-30 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hash_cabinet