szczupac 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/szczupac/version.rb +1 -1
- data/lib/szczupac.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2d747def49ff2b27088286fa6c5f388868b50bf5a91bc558ce6eabe606b70c1
|
4
|
+
data.tar.gz: 5aa49ae7455586547c1ad07d8fe16a0efe220b54187c99949c1aa9cddeaeb94b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fe7a1cf269fb19966378ac0febab1322639fc0720d217ed6071378f9e7d0a3086ad51684b12734c8b864489fbe5129d38b8e55e86f9e78f50cbebeaeaa1d62e
|
7
|
+
data.tar.gz: 7e3a3f13966678dc9ed56f9282890036497d7b7ef8e977432eb7399044142df764c344eb26e5570e7d7118af88f63e8949952eb8b69aaebd5fea3809101caed6
|
data/lib/szczupac/version.rb
CHANGED
data/lib/szczupac.rb
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
require_relative "szczupac/version"
|
4
4
|
|
5
5
|
module Szczupac
|
6
|
+
extend self
|
7
|
+
|
6
8
|
def call(**named_lanes)
|
7
9
|
named_lanes
|
8
10
|
.flat_map do |name, values|
|
@@ -15,8 +17,9 @@ module Szczupac
|
|
15
17
|
.map { |v| { name => v } }
|
16
18
|
.product([first_from_rest])
|
17
19
|
.map { |v| v.reduce(&:merge) }
|
20
|
+
.map { |v| v.sort_by { |k, _| named_lanes.keys.index(k) }.to_h }
|
18
21
|
end
|
19
22
|
.uniq
|
20
23
|
end
|
21
|
-
|
24
|
+
alias [] call
|
22
25
|
end
|