let's have this hash:
hash = {"a" => 1, "b" => {"c" => 3}}
hash.get_all_keys
=> ["a", "b", "c"]
how can i get all keys since hash.keys
returns just ["a", "b"]
let's have this hash:
hash = {"a" => 1, "b" => {"c" => 3}}
hash.get_all_keys
=> ["a", "b", "c"]
how can i get all keys since hash.keys
returns just ["a", "b"]
Please take a look of following code:
result:
New solution, considering @Bala's comments.
result:
Here is another approach :
I'm sure there is a more elegant solution, but this option works: