Are you sure that is failing? Your initial example works fine for me.
ruby-1.9.2-p290 :002 > array = ['bar']
=> ["bar"]
ruby-1.9.2-p290 :003 > array.include? 'foo' or array.include? 'bar'
=> true
As a matter of fact, if anything could be considered idiomatic it would be that one. The low precedence of or
allows this to work when you leave the parens off. This characteristic is something that should make it idiomatic to Ruby (and even Perl, which or
is a hold over from).
Option 1 is super clear, but considering you included the parens you really have no need to use or
. It's probably better to use ||, which has a high precedence like other operators and is just more common. I think using or
for the sake of it looking like english is not a great practice. It has a semantic meaning within the language and is probably best used for those qualities.
Option 2 is silly of course. If you're going to include parens, you might as well use them for the method signature.
Hope this helps.