nested_hash_helper 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +30 -3
- data/lib/nested_hash_helper/version.rb +1 -1
- 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: d47bcd2b3098e9a38ebbfdcf719b05c9872ec8bd
|
4
|
+
data.tar.gz: 4a48d0babbef72bfac21ecbab60fc7b067b4b807
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7e081f716d0b672ee3fd653cf881664ff6d17bceb9f6cbc59055fffdc9613030fed85794720c4a3d3b03cd8ce3505cbc29d82438315ddffb5a169b1220179c0
|
7
|
+
data.tar.gz: b4ab07d28a9b27a8498507a4aa592560ef02e957345c501ef0878f837b0e808b39ba439501cff87736c617d7b7d116a1870d546c8175deaf8e31b40757362ac3
|
data/README.md
CHANGED
@@ -69,12 +69,39 @@ Development has just begun and is active and we will fix bugs , enhance function
|
|
69
69
|
|
70
70
|
|
71
71
|
Syntax
|
72
|
-
```ruby
|
72
|
+
```ruby
|
73
73
|
a = {:gh => {:jj => {:pop => "bbb" , :olo => "ooooo"}} , :pp => "ooooo"}
|
74
74
|
a.find_deep_keys("ooooo")
|
75
75
|
output ==> [:gh , :jj , :olo]
|
76
|
-
```
|
77
|
-
|
76
|
+
```
|
77
|
+
|
78
|
+
### 6) hash_to_array
|
79
|
+
This method will convert the given nested hash to an array
|
80
|
+
|
81
|
+
Syntax
|
82
|
+
a = {:fg => {:gh => {:bn => "sdjkhds"} , :jk => ""} , :kl => {:gh => "" , :jk => "sdjkhds"}}
|
83
|
+
a.hash_to_array
|
84
|
+
output ==> [[:fg, [:gh, [:bn, "sdjkhds"]], [:jk, ""]], [:kl, [:gh, ""], [:jk, "sdjkhds"]]]
|
85
|
+
|
86
|
+
a = {:fg => {:gh => {:bn => ""}} , :kl =>{:jk => "nnnnnnn"}}
|
87
|
+
a.hash_to_array
|
88
|
+
output ==> [[:fg, [:gh, [:bn, ""]]], [:kl, [:jk, "nnnnnnn"]]]
|
89
|
+
|
90
|
+
### 7) deep_delete(key)
|
91
|
+
This method is used to delete a key in a nested hash
|
92
|
+
|
93
|
+
Syntax
|
94
|
+
a = {:fg => {:gh => {:bn => "sdjkhds"} , :bn => ""} , :kl => {:gh => "" , :jk => "sdjkhds"}}
|
95
|
+
a.deep_delete(:gh)
|
96
|
+
output ==> {:fg=>{:bn=>""}, :kl=>{:jk=>"sdjkhds"}}
|
97
|
+
|
98
|
+
### 8) find_all_values(key)
|
99
|
+
This method is used to find all the values of a given key
|
100
|
+
|
101
|
+
Syntax
|
102
|
+
data = {:students => {:a =>{:name => "vivek"} , :b=>{:name => "rakesh"}}}
|
103
|
+
data.find_all_values(:name)
|
104
|
+
output ==> ["vivek" , "rakesh"]
|
78
105
|
|
79
106
|
## Installation
|
80
107
|
|