Class: MinceMongoDb::DataStore
- Inherits:
-
Object
- Object
- MinceMongoDb::DataStore
- Includes:
- Singleton
- Defined in:
- lib/mince_mongo_db/data_store.rb
Instance Attribute Summary collapse
-
#db ⇒ Object
Returns the value of attribute db.
Class Method Summary collapse
Instance Method Summary collapse
- #collection(collection_name) ⇒ Object
-
#initialize ⇒ DataStore
constructor
A new instance of DataStore.
Constructor Details
#initialize ⇒ DataStore
Returns a new instance of DataStore.
22 23 24 |
# File 'lib/mince_mongo_db/data_store.rb', line 22 def initialize self.db = Connection.db end |
Instance Attribute Details
#db ⇒ Object
Returns the value of attribute db.
20 21 22 |
# File 'lib/mince_mongo_db/data_store.rb', line 20 def db @db end |
Class Method Details
.collection(collection_name) ⇒ Object
8 9 10 |
# File 'lib/mince_mongo_db/data_store.rb', line 8 def self.collection(collection_name) instance.collection(collection_name) end |
.db ⇒ Object
12 13 14 |
# File 'lib/mince_mongo_db/data_store.rb', line 12 def self.db instance.db end |
Instance Method Details
#collection(collection_name) ⇒ Object
16 17 18 |
# File 'lib/mince_mongo_db/data_store.rb', line 16 def collection(collection_name) db.collection(collection_name) end |