Module: PeaceLove::Doc::ClassMethods

Includes:
AngryHash::Extension::ClassMethods
Defined in:
lib/peace_love/document.rb

Instance Method Summary collapse

Instance Method Details

#collectionObject



34
35
36
# File 'lib/peace_love/document.rb', line 34

def collection
  @collection ||= PeaceLove.collection_for_mixin(self)
end

#mongo(options) ⇒ Object



27
28
29
# File 'lib/peace_love/document.rb', line 27

def mongo(options)
  PeaceLove.mixin_config[options[:db]][options[:collection]] = self
end

#mongo_collection(collection_name) ⇒ Object



30
31
32
# File 'lib/peace_love/document.rb', line 30

def mongo_collection(collection_name)
  PeaceLove.mixin_config[nil][collection_name] = self
end