I want to create a bit, that will contain security permissions for a given user.
In c#, I would do this by creating an enumeration, and then I would do some bit banging
Bitwse operations are trivial in Ruby.
> 1 | 2 # Create a bitmask from permission 2^0 + 2^1 => 3 > 3 & 1 == 1 # See if the bitmask contains the 2^0 permission => true > 3 & 4 == 4 # See if the bitmask contains the 2^2 permission => false