Class: CPRuntime::MongoClient
- Inherits:
-
Object
- Object
- CPRuntime::MongoClient
- Includes:
- CPRuntime
- Defined in:
- lib/cpruntime/MongoClient.rb,
lib/cpruntime/MongoClient.rb
Instance Method Summary collapse
Methods included from CPRuntime
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 |