Class: Desi::Configuration
- Inherits:
-
Object
- Object
- Desi::Configuration
- Includes:
- Singleton
- Defined in:
- lib/desi/configuration.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
Returns the value of attribute directory.
-
#server ⇒ Object
Returns the value of attribute server.
Instance Method Summary collapse
Instance Attribute Details
#directory ⇒ Object
Returns the value of attribute directory.
12 13 14 |
# File 'lib/desi/configuration.rb', line 12 def directory @directory end |
#server ⇒ Object
Returns the value of attribute server.
18 19 20 |
# File 'lib/desi/configuration.rb', line 18 def server @server end |
Instance Method Details
#load_configuration! ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/desi/configuration.rb', line 20 def load_configuration! config = defaults.merge(config_files_data) public_methods(false).select {|m| m.to_s =~ /=$/ }.each do |setter| attr_name = setter.to_s.tr('=', '') if config.has_key?(attr_name) send(setter, config[attr_name]) end end self end |