> I think it would be wise to have the plugin implementation broken down
> to class methods, dataset methods and instance methods (in a similar
> fashion to ActiveRecord plugins), e.g.:
On second thought, maybe it would be easier and DRYer to define an
apply method for each plugin, which also solves the problem of passing
options to the plugin:
module Sequel::Plugins::Tree
def self.apply(model, opts)
model.meta_def(:root) {...}
model.include(InstanceMethods)
end
module InstanceMethods
def parent
...
end
def children
...
end
end
end
sharon
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---