Class: Scruber::Mongo::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/scruber/mongo/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



6
7
8
9
# File 'lib/scruber/mongo/configuration.rb', line 6

def initialize
  @clients = {}
  @options = {}
end

Instance Attribute Details

#clientsObject

Returns the value of attribute clients.



4
5
6
# File 'lib/scruber/mongo/configuration.rb', line 4

def clients
  @clients
end

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/scruber/mongo/configuration.rb', line 4

def options
  @options
end

Instance Method Details

#configured?(client_name = :default) ⇒ Boolean

Returns:

  • (Boolean)


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

def configured?(client_name=:default)
  @clients.key?(client_name)
end

#load!(path) ⇒ Object



11
12
13
14
15
# File 'lib/scruber/mongo/configuration.rb', line 11

def load!(path)
  config = YAML.load_file(path).with_indifferent_access
  @clients = config['clients']
  @options = config['options']
end