On Aug 17, 2011, at 3:47 AM, Emmanuel Gomez wrote: > >> #<Class:0x1015a1d68> >> #<Class:0x10158b540> >> >> The last two (Enum & Flag) obviously didn't come out as expected. If I >> use T.enum.kind_of?(::DataMapper::Property::Enum) then it will show >> true. > > Enum.[] and Flag.[] both generate anonymous subclasses and then initialize an > instance for use. Personally, I question the need for an anonymous subclass > in this case, but I'm not ready to rework the Enum and Flag Properties, so… > take that for what it is: a whiny complaint about someone else's code that I > have little intention of addressing :P.
It's done like that so we can support providing options via #[]. Let me know if you have a better way of doing it. Cheers # solnic -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
