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