heavy_hash 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,9 +22,14 @@ class HeavyHash
22
22
  @parent.delete(@key) if empty?
23
23
  end
24
24
 
25
- def leaves(include_current_node=true)
26
- child_leaves = hash.values.map(&:leaves).flatten
27
- include_current_node ? content+child_leaves : child_leaves
25
+ def childrens_content(include_current_node=false)
26
+ cc = hash.values.map{|c| c.childrens_content true}.flatten
27
+ include_current_node ? content+cc : cc
28
+ end
29
+
30
+ def parents_content(include_current_node=false)
31
+ pc = root? ? [] : @parent.parents_content(true).flatten
32
+ include_current_node ? content+pc : pc
28
33
  end
29
34
 
30
35
  def empty?
@@ -1,3 +1,3 @@
1
1
  module HeavyHash
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Niko Dittmann
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-31 00:00:00 +01:00
17
+ date: 2011-02-01 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies: []
20
20