2012-12-24から1日間の記事一覧
each_with_indexは配列やhashをブンまわすときに便利なメソッドです。 これに多重配列を渡すときは毎回毎回ary[0],ary[1]のような感じで読み出ししていたのですが ary = [["Ichiro",23],["Jiro",21]] ary.each_with_index do |(name,age),count| puts %Q(#{c…
each_with_indexは配列やhashをブンまわすときに便利なメソッドです。 これに多重配列を渡すときは毎回毎回ary[0],ary[1]のような感じで読み出ししていたのですが ary = [["Ichiro",23],["Jiro",21]] ary.each_with_index do |(name,age),count| puts %Q(#{c…