Method: Xmvc::Config.setup
- Defined in:
- lib/xmvc/config.rb
.setup(settings = {}) ⇒ Object
Sets up the configuration by storing the given settings.
Parameters
- settings<Hash>
-
Configuration settings to use. These are merged with the defaults.
Returns
The configuration as a hash.
:api: private
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/xmvc/config.rb', line 54 def setup(settings = {}) # Merge new settings with any existing configuration settings settings = @configuration.merge(settings) unless @configuration.nil? # Merge new settings with default settings config = defaults.merge(settings) config = config.merge(load(config[:environment])) dev_mode = config[:environment] == "development" @configuration = config.to_mash end |