Class: CFRuntime::MongoConnection
- Inherits:
-
Object
- Object
- CFRuntime::MongoConnection
show all
- Defined in:
- lib/cf-runtime/mongodb.rb
Instance Method Summary
collapse
Constructor Details
#initialize(connection, db_name) ⇒ MongoConnection
Returns a new instance of MongoConnection.
65
66
67
68
|
# File 'lib/cf-runtime/mongodb.rb', line 65
def initialize(connection, db_name)
@target = connection
@dbname = db_name
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
80
81
82
|
# File 'lib/cf-runtime/mongodb.rb', line 80
def method_missing(method, *args, &block)
@target.send(method, *args, &block)
end
|
Instance Method Details
#db(db_name = @dbname, opts = {}) ⇒ Object
70
71
72
|
# File 'lib/cf-runtime/mongodb.rb', line 70
def db(db_name=@dbname, opts={})
@target.send('db', db_name, opts)
end
|
#target ⇒ Object
74
75
76
|
# File 'lib/cf-runtime/mongodb.rb', line 74
def target()
@target
end
|