Class: CPRuntime::MongoClient

Inherits:
Object
  • Object
show all
Includes:
CPRuntime
Defined in:
lib/cpruntime/MongoClient.rb,
lib/cpruntime/MongoClient.rb

Instance Method Summary collapse

Methods included from CPRuntime

#credential_map

Instance Method Details

#create_from_svc(hostname) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/cpruntime/MongoClient.rb', line 15

def create_from_svc(hostname)
  m = credential_map("mongo")
  c = m[hostname];
  p c
  db = Mongo::Connection.new(c.host,c.port).db(c.db)
  auth = db.authenticate(c.username,c.password)
  return db
end