hello,

I'm writing a new class in the C level

I'd like an object to have binary states (each state is either true of
false). If I were using plain C, I'd do


typedef enum
{
     FLAG_FOO = 1 << 1,
     FLAG_BAR = 1 << 2,
     FLAG_..
        :
        :
} FLAGS

uint flag;

if (flag & FLAG_FOO) {
  :
  :
}

how should I do this in Ruby?  It seems to me like using an instance
variable for each state is expensive if my object has 20 independent
states.  And also I'd like to avoid wrapping C struct for the object.

is there some convenience and fast function?

regards,
--
           yashi