Module: Scruber::Mongo

Defined in:
lib/scruber/mongo.rb,
lib/scruber/mongo/factory.rb,
lib/scruber/mongo/version.rb,
lib/scruber/mongo/configuration.rb

Defined Under Namespace

Modules: Factory Classes: Configuration

Constant Summary collapse

VERSION =
"0.1.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.clients=(value) ⇒ Object (writeonly)

Sets the attribute clients

Parameters:

  • value

    the value to set the attribute clients to.



17
18
19
# File 'lib/scruber/mongo.rb', line 17

def clients=(value)
  @clients = value
end

.configurationObject



19
20
21
# File 'lib/scruber/mongo.rb', line 19

def configuration
  @configuration ||= ::Scruber::Mongo::Configuration.new
end

Class Method Details

.client(client_name = :default) ⇒ Object



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

def client(client_name=:default)
  @clients ||= {}
  @clients[client_name] ||= Scruber::Mongo::Factory.create_client(client_name)
end

.configure {|configuration| ... } ⇒ Object

Yields:



23
24
25
# File 'lib/scruber/mongo.rb', line 23

def configure(&block)
  yield configuration
end