module Mongomatic

This class has dubious semantics and we only have it so that people can write params instead of params and they get the same value for both keys.

Public Class Methods

db() click to toggle source

Returns an instance of Mongo::DB

# File lib/mongomatic.rb, line 10
def db
  @db
end
db=(obj) click to toggle source

Set to an instance of Mongo::DB to be used for all models:

Mongomatic.db = Mongo::Connection.new().db('mydb')
# File lib/mongomatic.rb, line 16
def db=(obj)
  unless obj.is_a?(Mongo::DB)
    raise(ArgumentError, "Must supply a Mongo::DB object")
  end; @db = obj
end