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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7e10b8c75dbdfdf080bd009d3302062054f6cb4
4
- data.tar.gz: 70b94b42f847c4d9479ba70bcd76281cbc070790
3
+ metadata.gz: 88220785136babdaf6fb26f65d54e8862b04866e
4
+ data.tar.gz: 8a4c700a14fb121386b5f3327890fe473bb24075
5
5
  SHA512:
6
- metadata.gz: 8f1620fbb853986345d3ff7fa5cba3d5e05c1eba74a884e757f4bfef7b50078be6987564f134335b217ef884b9b5a5f31472833b2de52b3d9a71967a4f13e9e1
7
- data.tar.gz: b56d38d92a782908f55fdd5349218d1c03459a0f4dd17b87a7a6673a327e4a9da4dc44612c819e88a599fadd8f92d7e80ede3fdb8f06444ef9662ac40a42748f
6
+ metadata.gz: 489b11522d244df103cfdf187f12cac2de6e066e3be4a64472d6aea8d8dea2d4cffb9f6990eeac3783722a7a9ceaa47e8794f665c09052b14d266fab8e7d0478
7
+ data.tar.gz: f531257ed2ba8999dbe607a80a4284a518b28340802d4cf78736d6e978c0821629856e1217f6c043e14574622c9e418184d5cce26a0ff6302e14a3e130da56b2
@@ -1,3 +1,3 @@
1
1
  module Iteraptor
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iteraptor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksei Matiushkin