let\'s have this hash:
hash = {\"a\" => 1, \"b\" => {\"c\" => 3}} hash.get_all_keys => [\"a\", \"b\", \"c\"]
how can i get all key
I'm sure there is a more elegant solution, but this option works:
blah = {"a" => 1, "b" => {"c" => 3}} results = [] blah.each do |k,v| if v.is_a? Hash results << k v.each_key {|key| results << key} else results << k end end puts results