hash-as-tree 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hash/as/tree.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f126d5a681da5ff54e1d477d8b855b14854d860
|
4
|
+
data.tar.gz: 8997d3f758b9f09c48d5b07a77b23fb2a817617a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12752602b8e3cf7ee1d193face699514b2d12863c503075ba210eaa4d4fed7575409313c8eb4591878471f9048275f3411101d139cfb368994ed7c5fc9e00b38
|
7
|
+
data.tar.gz: 9f6b21510a8a49793ea56b22508de39373e84f7848d2731a1d23d3a5eb30a8160a8d06080d1886d8244b814d9fb37d1782d8a1e749ea392e66f437e5a5643be8
|
data/lib/hash/as/tree.rb
CHANGED
@@ -28,8 +28,10 @@ class Hash
|
|
28
28
|
if passed_node == returned_node
|
29
29
|
passed_node.children.each &[nodes, :push]
|
30
30
|
else
|
31
|
-
|
32
|
-
|
31
|
+
if parent = passed_node.parent
|
32
|
+
parent.value.delete passed_node.key
|
33
|
+
parent.value[returned_node.key] = returned_node.value
|
34
|
+
end
|
33
35
|
returned_node.children.each &[nodes, :push]
|
34
36
|
end
|
35
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hash-as-tree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatoly Chernow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: to_proc
|