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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76ebe04ac7eac3f35fe61a2d1786a19119a1d43c
4
- data.tar.gz: 24eda8a1904f0bb5cda4d50b0f5a2cc3973d4099
3
+ metadata.gz: d47bcd2b3098e9a38ebbfdcf719b05c9872ec8bd
4
+ data.tar.gz: 4a48d0babbef72bfac21ecbab60fc7b067b4b807
5
5
  SHA512:
6
- metadata.gz: 27988c8e92a6cafc526a884e63f5643d29faed7947f55f529de252879b58d335285fcfb848233cf99580834cf535d57b6836d2c25d2eb4ab8dd89290c21ee449
7
- data.tar.gz: bb9abbae013077a9e79fa3d19c37e6f099186543e8536ce638f3d2e760d5bd098876f9774570f4ad70979c3d346d728012a97e32abbd6afc38319d1ea29509aa
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
 
@@ -1,3 +1,3 @@
1
1
  module NestedHashHelper
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nested_hash_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vivek n