From: 7stud -- Date: 2011-05-28T05:30:24+09:00 Subject: Re: Hash .each and different action for each key Leigh Daniels wrote in post #1001612: > if k == "a" > one(v) > end > if k == "b" > two(v) > end > if k == "c" > three(v) > end > end That is a horribly inefficient construct: three if tests must be exectued for every key--no matter what. Compare that to: if k == 'a' elsif k == 'b' elsif k == 'c' else A 'when statement' works similarly. -- Posted via http://www.ruby-forum.com/.