Module: Configurethis
- Defined in:
- lib/configurethis.rb,
lib/configurethis/version.rb,
lib/configurethis/configuration.rb,
lib/configurethis/value_container.rb,
lib/configurethis/mock_configuration.rb,
lib/configurethis/configurethis_properties.rb
Defined Under Namespace
Classes: Configuration, ConfigurethisProperties, MockConfiguration, ValueContainer
Constant Summary
collapse
- VERSION =
"1.0.5"
Class Method Summary
collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
41
42
43
|
# File 'lib/configurethis.rb', line 41
def method_missing(method, *args)
configuration[method.to_s]
end
|
Class Method Details
.root_path=(path) ⇒ Object
Instance Method Details
#configuration_path ⇒ Object
18
19
20
|
# File 'lib/configurethis.rb', line 18
def configuration_path
configuration.path
end
|
37
38
39
|
# File 'lib/configurethis.rb', line 37
def configure_this_with(path)
@configuration_file = path
end
|
#reload_configuration ⇒ Object
45
46
47
48
|
# File 'lib/configurethis.rb', line 45
def reload_configuration
@configuration = nil
return self
end
|
#set_root=(key) ⇒ Object
22
23
24
|
# File 'lib/configurethis.rb', line 22
def set_root=(key)
configuration.root = key.to_s
end
|
#test_with(values) ⇒ Object
Meant for testing different scenarios and avoid using the real configuration values in your tests/specs.
To use, pass a hash that represents the values you like so that it mirrors the yml files structure.
33
34
35
|
# File 'lib/configurethis.rb', line 33
def test_with(values)
@configuration = MockConfiguration.new values
end
|