H
Hal E. Fulton
I just noticed something that I either didn't know
or just forgot.
You can use the *array notation to specify values
for the when clause in a case statement:
list1 = [1,2,6,8,9]
list2 = [3,4,5,7,10]
case item
when *list1
puts "in list 1"
when *list2
puts "in list 2"
end
Cool, eh?
Hal
or just forgot.
You can use the *array notation to specify values
for the when clause in a case statement:
list1 = [1,2,6,8,9]
list2 = [3,4,5,7,10]
case item
when *list1
puts "in list 1"
when *list2
puts "in list 2"
end
Cool, eh?
Hal