On Wed, May 20, 2009 at 04:57:08PM +0200, Pesho Petrov wrote:
> 
> hello,
> 
> i'd like to combine to clauses of my case statement, and I do this:
> 
> case check
> when value1
>    //do something
> when value2
>    //do something (the same as in the first when)
> end
> 
> 
> But how can I combine the two "when"-s. It is redundant to write the
> same code to "do something"
[...]

case check
when value1, value2
   //do something
end

> Thanks!
--Greg


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to