Class: Faststep::Connection

Inherits:
Object
  • Object
show all
Defined in:
ext/faststep/connection.c,
lib/faststep/connection.rb

Constant Summary

DEFAULT_PORT =
27017

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

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?

Returns:

  • (Boolean)

- (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

- (Boolean) master?

Returns:

  • (Boolean)