in rails I add:<p><pre><code>  [:foo_boolean1, :foo_boolean2].each_with_index do |flavor, i|
    power = 1 
    i.times do
      power *= 2
    end 
    define_method &quot;has_#{flavor}&quot; do
      (foo_options &amp; power) &gt; 0 
    end 
    define_method &quot;has_#{flavor}=&quot; do |value|
      value = value == &#x27;1&#x27; if value.class == String
      current_value = self.send(&quot;has_#{flavor}&quot;)
      if (current_value &amp;&amp; !value) || (!current_value &amp;&amp; value)
        self.foo_options = foo_options ^ power 
      end 
    end 
  end 
</code></pre>
which lets me access each col like normal.  blah.has_foo_boolean1 or blah.has_foo_boolean1=true etc.