Class: Scruber::Mongo::Configuration
- Inherits:
-
Object
- Object
- Scruber::Mongo::Configuration
- Defined in:
- lib/scruber/mongo/configuration.rb
Instance Attribute Summary collapse
-
#clients ⇒ Object
Returns the value of attribute clients.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #configured?(client_name = :default) ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #load!(path) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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
#clients ⇒ Object
Returns the value of attribute clients.
4 5 6 |
# File 'lib/scruber/mongo/configuration.rb', line 4 def clients @clients end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/scruber/mongo/configuration.rb', line 4 def @options end |
Instance Method Details
#configured?(client_name = :default) ⇒ 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 |