control_flow/case_basic.rb
tests/_examples/control_flow/case_basic.rb in the metorex repository.
# Basic case statement with integer matching
x = 2
case x
when 0
puts "zero"
when 1
puts "one"
when 2
puts "two"
else
puts "other"
end