Ruby: introduction to blocks

Example:

[1,2,3].each do |i|
  puts i
end
Blocks are code between braces or between do and end.

Solution:

[1,2,3].each { |i| puts i }  // Alternative using braces

Beginner's Guide to Ruby