#195 ✓resolved
Ben Burkert

[Patch] Enum & Flag types

Reported by Ben Burkert | March 28th, 2008 @ 06:38 PM

Here's a patch for the Enum & Flag types. I followed sam's pastie here: http://pastie.textmate.org/priva...

Enum & Flag are basically the same, only Enum can have only 1 value at a time, while Flag can have multiple values.

I had some trouble with the Class.new(Enum) call from sam's pastie. It was causing errors in the self.inherited method defined in Type.configure, so i changed it to Enum.dup and it seemed to work fine.

One thing I didn't add was a max flag count for the Flag type. Max flags allowed == number of bytes per integer in the database, which i'm not sure about.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Tags

Pages