From: Peter Alvin Date: 2008-09-29T06:19:01+09:00 Subject: irb: 1 & 1 => 1, not true huh? I thought 1 & 1 => true In irb I did: puts 1 & 1 and get 1 shouldn't I get true? Bottom line is this: What is Ruby idiom to test for bit mask? Is there a more simple way to write: if session[:permissions] & Permissions::SomeMask == Permissions::SomeMask # user has permission to wash clothes, etc. end TIA, Pete -- Posted via http://www.ruby-forum.com/.