Much cleaner and simpler version, using instance_eval{ define_method()
{} }: http://pastie.caboo.se/123990

  Aman Gupta

On Nov 30, 11:24 pm, Aman Gupta <[EMAIL PROTECTED]> wrote:
> I thought about this but read about some strange behavior with class
> variables in Ruby, where a class variables are shared among
> subclasses?
>
> http://www.oreillynet.com/ruby/blog/2007/01/nubygems_dont_use_class_v...
>
>   Aman Gupta
>
> On Nov 30, 11:13 pm, Luis Lavena <[EMAIL PROTECTED]> wrote:
>
> > On Dec 1, 12:35 am, Aman Gupta <[EMAIL PROTECTED]> wrote:
>
> > > So here's a simple Orderable I started working 
> > > on:http://pastie.caboo.se/123976
>
> > > It works well and good, except I can't figure out a good way to accept
> > > and store options given to is.. For example, if instead of the
> > > default :position field, my table instead had a :pos, I want to be
> > > able to do:
>
> > > is :Orderable, :field => :pos
>
> > > I can access opts[:field] in my Sequel::Plugin::Orderable.setup, but
> > > where do I store it so its available in all instances of the class?
>
> > >   Aman Gupta
>
> > Aman, what about in some @@orderable_options for the class?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" 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/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to