cheat sheets.

$ cheat each
collection.each iteration syntax

iterating over a list
 [1, 2, 3].each { |n| puts n }

iterating over a hash
 {'one' => 1, 'two' => 2, 'three' => 3}.each { |k,v| puts "#{k} is #{v}" }
Version 1, updated 318 days ago.
. o 0 ( edit | history )
( add new | see all )