Hi all,
I have been trying to find a solution for this for quite sometime now.
I have a complex hash structure something like this eg
{“user”=>{“name”=>“test”, “address”=>{“line1”=>“bethesda”,
“town”=>“cambridge”}}}
I need to retrieve all the keys for this hash or any kind of hash simple
or complex(generic solution).
I do not know any keys names but want the entire list in an array.
Final output =
[ “user”][“name”],
[ “user”][“address”][“line1”],
[ “user”][“address”][“town”]
array = hash.keys returns for a simple hash structure but would not work
for the above kind.
Would this be possible? Thanks for looking into it