Class: Low::Mongo::Local
- Inherits:
-
Object
- Object
- Low::Mongo::Local
- Includes:
- Low::Mongo
- Defined in:
- lib/low/mongo.rb
Overview
For connecting to Mongo on localhost.
Instance Attribute Summary collapse
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(database, opts = {}) ⇒ Local
constructor
Specify the database upon initialization and assume that the host is localhost (unless told otherwise).
Methods included from Low::Mongo
#[], #connection, #db, #grid, #reset_connection!
Constructor Details
#initialize(database, opts = {}) ⇒ Local
Specify the database upon initialization and assume that the host is localhost (unless told otherwise).
57 58 59 60 61 62 |
# File 'lib/low/mongo.rb', line 57 def initialize(database, opts = {}) @database = database @host = opts[:host] || 'localhost' @username = opts[:username] @password = opts[:password] end |
Instance Attribute Details
#database ⇒ Object (readonly)
Returns the value of attribute database.
53 54 55 |
# File 'lib/low/mongo.rb', line 53 def database @database end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
53 54 55 |
# File 'lib/low/mongo.rb', line 53 def host @host end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
53 54 55 |
# File 'lib/low/mongo.rb', line 53 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
53 54 55 |
# File 'lib/low/mongo.rb', line 53 def username @username end |