From: vimal Date: 2009-02-17T15:09:32+09:00 Subject: Re: Hash :: Recursive traversing and stripping the values Hi Guys, I found out another way to do this using a 'lambda' function I am just curious to know, how effective is this compared to the above mentioned suggestions ----------------------------------------------------------------------------------- Code modified from source http://blog.hasmanythrough.com/2008/6/20/recursive-lambda ----------------------------------------------------------------------------------- thunk = lambda do |key,value| case value when String then value.strip! when Hash then value.each(&thunk) when Array then value.each {|vv| vv.strip!} end end -------------------------------- Call -------------------------------- .each(&thunk) Thanks, Vimal Das Waiting with curiosity :-|