From: Love U Ruby Date: 2013-04-02T02:52:43+09:00 Subject: Re: Recursion with Hash I just corrected it,but different approach: p RUBY_VERSION h = {a: {b: {c: 23}}} def hash_brek(h) h.each_with_object([]) do |i,temp| if h.eql? ({c: 23}) then return temp.push(i.first,i.last) else return temp.push(i.first,i.last) + hash_brek(i.last) end end end p hash_brek(h) output: D:\Rubyscript\My ruby learning days\Scripts>practice.rb "2.0.0" [:a, {:b=>{:c=>23}}, :b, {:c=>23}, :c, 23] D:\Rubyscript\My ruby learning days\Scripts> -- Posted via http://www.ruby-forum.com/.