On Mon, Sep 3, 2012 at 1:47 PM, Jan E. <[email protected]> wrote:
> You can either use the logical "or":
>
> if A == 13 or A == 14
>   ...
>
> Or you can use Array#include:
>
> if [13, 14].include? A
>   ...
>
> The latter doesn't really make sense here, but it's useful when you have
> a lot of values.

And for integers we can also facilitate ranges

irb(main):001:0> (13..17).include? 15
=> true

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google 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 https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to