Class: Faststep::Connection
- Inherits:
-
Object
- Object
- Faststep::Connection
- Defined in:
- lib/faststep/connection.rb,
ext/faststep/connection.c
Constant Summary collapse
- DEFAULT_PORT =
27017
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Class Method Summary collapse
Instance Method Summary collapse
- #connect! ⇒ Object
- #connected? ⇒ Boolean
- #db(database_name) ⇒ Object (also: #[])
- #disconnect! ⇒ Object
- #drop_database(database_name) ⇒ Object
- #initialize ⇒ Object constructor
- #master? ⇒ Boolean
Constructor Details
#initialize ⇒ Object
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
5 6 7 |
# File 'lib/faststep/connection.rb', line 5 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
5 6 7 |
# File 'lib/faststep/connection.rb', line 5 def port @port end |
Class Method Details
.new ⇒ Object
Instance Method Details
#connect! ⇒ Object
#connected? ⇒ Boolean
#db(database_name) ⇒ Object Also known as: []
7 8 9 |
# File 'lib/faststep/connection.rb', line 7 def db(database_name) Db.new(database_name, self) end |
#disconnect! ⇒ Object
#drop_database(database_name) ⇒ Object
13 14 15 |
# File 'lib/faststep/connection.rb', line 13 def drop_database(database_name) db(database_name).drop end |