In Ruby, while "and" exists, it's not quite a synonym for "&&" --- so, in comparisons like this, you should use "&&"

More information on the topic: http://devblog.avdi.org/2010/08/02/using-and-and-or-in-ruby/