Module: Mongo::Configure

Defined in:
lib/mongo/configure.rb,
lib/mongo/configure/uri.rb,
lib/mongo/configure/version.rb

Defined Under Namespace

Classes: Config, URI

Constant Summary collapse

VERSION =
"2.0.0"

Class Method Summary collapse

Class Method Details

.currentObject


28
29
30
# File 'lib/mongo/configure.rb', line 28

def current
  @config ||= Config.new 'localhost/database'
end

.from_database(name) ⇒ Object


25
26
27
# File 'lib/mongo/configure.rb', line 25

def from_database(name)
  @config = Config.new URI.new.tap { |uri| uri.database = name }
end

.from_uri(uri) ⇒ Object


22
23
24
# File 'lib/mongo/configure.rb', line 22

def from_uri(uri)
  @config = Config.new URI.parse uri
end