Class: MongoBijou::Client
- Inherits:
-
Object
- Object
- MongoBijou::Client
- Includes:
- Singleton
- Defined in:
- lib/mongo_bijou/client.rb
Overview
MongoDB connector.
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#db_name ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
Returns a new instance of MongoClient.
Constructor Details
#initialize ⇒ Client
Returns a new instance of MongoClient.
13 14 15 16 |
# File 'lib/mongo_bijou/client.rb', line 13 def initialize @db_name = 'default' @client = Mongo::Client.new(['127.0.0.1:27017'], database: @db_name) end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
10 11 12 |
# File 'lib/mongo_bijou/client.rb', line 10 def client @client end |
#db_name ⇒ Object
Returns the value of attribute client.
10 11 12 |
# File 'lib/mongo_bijou/client.rb', line 10 def db_name @db_name end |