Module: MongoHashie::ClassMethods

Defined in:
lib/mongo-hashie/base.rb

Instance Method Summary collapse

Instance Method Details

#connectionObject



35
36
37
38
# File 'lib/mongo-hashie/base.rb', line 35

def connection
  Mongo::Connection.new(MongoHashie::Configuration.host, MongoHashie::Configuration.port,
    :pool_size => MongoHashie::Configuration.pool_size, :pool_timeout => MongoHashie::Configuration.timeout)
end

#dbObject



40
# File 'lib/mongo-hashie/base.rb', line 40

def db; @@db ||= connection.db(MongoHashie::Configuration.database); end