Here's some code based on the Config concept: http://pastie.caboo.se/123988

Alternatives are to use instance_eval{ define_method(){} }, or traits
(http://source.ramaze.net/#/lib/ramaze/snippets/object/traits.rb)

I'm going to experiment with both and see what works best.

  Aman Gupta

On Nov 30, 11:16 pm, "Wayne E. Seguin" <[EMAIL PROTECTED]> wrote:
> Ok, current thought is to keep a config lookup hash:
>
> module Sequel
>   module Plugins
>     Config = {}
>   end
> end
>
> Usage:
> Config[ModelClass][PluginName] = {*options}
>
> class LineItem < Sequel::Model(:line_items)
>   is_a :list, :field => :position
> end
>
> With a helper method in the class itself:
>
> LineItem.plugin_options[:field] # => :position
>
> One open question: Can anyone think of a case where we'd want to be able to
> use a single plugin twice on the same model?
>
> Thanks,
>
>   ~Wayne
--~--~---------~--~----~------------~-------~--~----~
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