Module: RSolr::Ext::Model::Pluggable

Defined in:
lib/rsolr-ext/model.rb

Overview

ripped from MongoMapper!

Instance Method Summary collapse

Instance Method Details

#plugin(mod) ⇒ Object



20
21
22
23
24
25
# File 'lib/rsolr-ext/model.rb', line 20

def plugin(mod)
  extend mod::ClassMethods     if mod.const_defined?(:ClassMethods)
  include mod::InstanceMethods if mod.const_defined?(:InstanceMethods)
  mod.configure(self)          if mod.respond_to?(:configure)
  plugins << mod
end

#pluginsObject



16
17
18
# File 'lib/rsolr-ext/model.rb', line 16

def plugins
  @plugins ||= []
end