iteraptor 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/iteraptor/version.rb +1 -1
- data/lib/iteraptor.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88220785136babdaf6fb26f65d54e8862b04866e
|
4
|
+
data.tar.gz: 8a4c700a14fb121386b5f3327890fe473bb24075
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 489b11522d244df103cfdf187f12cac2de6e066e3be4a64472d6aea8d8dea2d4cffb9f6990eeac3783722a7a9ceaa47e8794f665c09052b14d266fab8e7d0478
|
7
|
+
data.tar.gz: f531257ed2ba8999dbe607a80a4284a518b28340802d4cf78736d6e978c0821629856e1217f6c043e14574622c9e418184d5cce26a0ff6302e14a3e130da56b2
|
data/lib/iteraptor/version.rb
CHANGED
data/lib/iteraptor.rb
CHANGED
@@ -9,7 +9,7 @@ module Iteraptor
|
|
9
9
|
|
10
10
|
%i(cada mapa).each do |m|
|
11
11
|
define_method m do |root = nil, parent = nil, &λ|
|
12
|
-
return enum_for(m) unless λ
|
12
|
+
return enum_for(m, root, parent) unless λ
|
13
13
|
send_to = [Hash, Array, Enumerable].detect { |c| is_a? c }
|
14
14
|
send_to && send("#{m}_in_#{send_to.name.downcase}", root || self, parent, &λ)
|
15
15
|
end
|
@@ -18,7 +18,7 @@ module Iteraptor
|
|
18
18
|
# rubocop:disable Metrics/CyclomaticComplexity
|
19
19
|
# rubocop:disable Metrics/MethodLength
|
20
20
|
def segar filter
|
21
|
-
return enum_for(:segar) unless block_given?
|
21
|
+
return enum_for(:segar, filter) unless block_given?
|
22
22
|
|
23
23
|
cada.with_object({}) do |(parent, element), memo|
|
24
24
|
p = parent.split(DELIMITER)
|
@@ -26,7 +26,7 @@ module Iteraptor
|
|
26
26
|
when String then p.include?(filter)
|
27
27
|
when Symbol then p.include?(filter.to_s)
|
28
28
|
when Regexp then p.any? { |key| key =~ filter }
|
29
|
-
when Array then parent.include?(filter.join(DELIMITER))
|
29
|
+
when Array then parent.include?(filter.map(&:to_s).join(DELIMITER))
|
30
30
|
end
|
31
31
|
yield parent, element
|
32
32
|
memo[parent] = element
|