hashedrecord 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hashedrecord/filtered.rb +21 -0
  3. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8e102a7551d6455e1c4c8520c53e4d88078e32a17ee077d43dee72bed1ba4c7
4
- data.tar.gz: a2081f1f61b7e3ba946bc66ed6254ba70841e17728f734aa6daf11b7b8355c55
3
+ metadata.gz: e253cb99355f060de0bd06686fc640d6bfe2ac21187b0441cbe0bc51587fe2d1
4
+ data.tar.gz: a5b324ef04adfa5aec2e9b5636eb0e6cd5a790c4d0213656d7db79f7d16d52c8
5
5
  SHA512:
6
- metadata.gz: 308d3ee1b96359140decb31240c84e292fcdfc178755cf3b974b0b5b76f32d6296b09dbfa082d59dbc502352a6fdb2f1c79e5c9d5c61f05bcdb7550f1d4bbca6
7
- data.tar.gz: fd6363e07bfa56e89ac40e4900712739e6eaa91d36ae84aa4f889b38ff3baac4289dc664da3360b8cd394b5190febd588ebe1e9c7f4d536d7b7f8c633ce1092f
6
+ metadata.gz: 15aba5e34a5ebc384b89173ea0baea7027aa69b69124b8def4b1e596fefd34a997e6782acaa75ec287309b38064674b3427c9001c84cbc08e3e3f8ad5fcee03d
7
+ data.tar.gz: 48384009c5ee5761c59060061b81df17ac0adf8d5a096683c25f0dd40db2434270e235691a460c25c6efdb5d93a3be6d31b2468f0404d0707e3928983c29a9f8
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Hashedrecord
4
+ class Filtered
5
+ include Enumerable
6
+ include ::HashedRecord::Chainable
7
+
8
+ def initialize(parent, filter)
9
+ @parent = parent
10
+ @filter = filter
11
+ end
12
+
13
+ def call(child_filter = [])
14
+ parent.call([filter] + child_filter)
15
+ end
16
+
17
+ private
18
+
19
+ attr_reader :filter, :parent
20
+ end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hashedrecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serg Tyatin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-17 00:00:00.000000000 Z
11
+ date: 2020-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -45,6 +45,7 @@ extensions: []
45
45
  extra_rdoc_files: []
46
46
  files:
47
47
  - lib/hashedrecord.rb
48
+ - lib/hashedrecord/filtered.rb
48
49
  homepage: https://github.com/2rba/hashedrecord
49
50
  licenses:
50
51
  - MIT