Hi All,
I would like to access the case statements expression from within a then clause i.e.
food = "cheese"
case food
when "dip" then "carrot sticks"
when "cheese" then "#{expr} crackers"
else
"mayo"
end
where in this case expr would be the current value of food. In this case I know, I could simply access the variable food, however there may be cases where the value is no longer accessible (array.shift etc..). Other than moving the expr out into a local variable and then accessing it, is there a way of directly accessing the value of the cases expr?
Roja
p.s. I know that this specific example is trivial its mealy an example scenario.