Class: Twroute::Application::Config
- Inherits:
-
Object
- Object
- Twroute::Application::Config
- Defined in:
- lib/twroute/application/config.rb
Class Method Summary collapse
Class Method Details
.load_config(file) ⇒ Object
31 32 33 |
# File 'lib/twroute/application/config.rb', line 31 def self.load_config(file) Application.config = self.open_struct(YAML.load_file(file)) end |
.open_struct(hash) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/twroute/application/config.rb', line 34 def self.open_struct(hash) hash.inject(OpenStruct.new) do |result, (key, value)| result.send(key + '=', value.is_a?(Hash) ? open_struct(value) : value) result end end |