What is the correct way to write a switch statement in Ruby?

Both are solid approaches, but here’s something cool—case can work like a series of if statements when no variable is provided:

age = 25

case 
when age < 18
  puts "You're a minor"
when age >= 18 && age < 65
  puts "You're an adult"
else
  puts "You're a senior citizen"
end

This is useful when you need condition-based logic rather than direct comparisons.