Case Statements
Case statements are great for number ranges where you can simply set them up like:
case grade
when (90..100) then "A"
when (80..89) then "B"
when (70..79) then "C"
when (60..69) then "D"
when (0..59) then "F"
else "error"
end
You can use them for the ever present FizzBuzz problem.
(1..20).each do |i|
case
when i % 3 == 0
print "Fizz"
when i % 5 == 0
print "Buzz"
else
print i
end
puts ""