J
J2M
Hi,
I would like to test a string foo against an array bar in as case...
when clause and would like to know the best way to do this. I am sure
why_ did something neat with an * operator, but can't find any
reference. I could do it long hand, but that just aint rubyish.
e.g.
foo = "that"
bar = %(this that other)
case foo
when (some clever way of test for foo in the array bar)
I would like to test a string foo against an array bar in as case...
when clause and would like to know the best way to do this. I am sure
why_ did something neat with an * operator, but can't find any
reference. I could do it long hand, but that just aint rubyish.
e.g.
foo = "that"
bar = %(this that other)
case foo
when (some clever way of test for foo in the array bar)