Sha256: 1fab5a8384e2af5cbca8bba01e753e99068b443f743d6a4322c34972c46cb5ff

Contents?: true

Size: 338 Bytes

Versions: 14

Compression:

Stored size: 338 Bytes

Contents

module MongoMapper
  module Plugins
    def plugins
      @plugins ||= []
    end
    
    def plugin(mod)
      if mod.const_defined?(:ClassMethods)
        extend mod::ClassMethods
      end
      
      if mod.const_defined?(:InstanceMethods)
        include mod::InstanceMethods
      end
      
      plugins << mod
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
mongo_mapper-unstable-2010.1.22 lib/mongo_mapper/plugins.rb
mongo_mapper-unstable-2010.1.21 lib/mongo_mapper/plugins.rb
mongo_mapper-unstable-2010.1.20 lib/mongo_mapper/plugins.rb
mongo_mapper-unstable-2010.1.19 lib/mongo_mapper/plugins.rb
jmonteiro-mongo_mapper-0.1.7 lib/mongo_mapper/plugins.rb
mongo_mapper-unstable-2010.1.18 lib/mongo_mapper/plugins.rb
jmonteiro-mongo_mapper-0.1.6 lib/mongo_mapper/plugins.rb
jmonteiro-mongo_mapper-0.1.5 lib/mongo_mapper/plugins.rb
mongo_mapper-unstable-2010.1.17 lib/mongo_mapper/plugins.rb
jmonteiro-mongo_mapper-0.1.4 lib/mongo_mapper/plugins.rb
jmonteiro-mongo_mapper-0.1.2 lib/mongo_mapper/plugins.rb
jmonteiro-mongo_mapper-0.1.1 lib/mongo_mapper/plugins.rb
jmonteiro-mongo_mapper-0.1.0 lib/mongo_mapper/plugins.rb
mongo_mapper-unstable-2010.1.12 lib/mongo_mapper/plugins.rb