Class: Skr::Core::Configuration
- Inherits:
-
Object
- Object
- Skr::Core::Configuration
- Includes:
- Skr::Concerns::AttrAccessorWithDefault
- Defined in:
- lib/skr/core/configuration.rb
Direct Known Subclasses
Class Method Summary collapse
-
.config_option(name, default) ⇒ Object
Since changing a config value inadvertently can have pretty drastic consequences that might not be discovered immediately, we log each time a value is changed.
Class Method Details
.config_option(name, default) ⇒ Object
Since changing a config value inadvertently can have pretty drastic consequences that might not be discovered immediately, we log each time a value is changed
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/skr/core/configuration.rb', line 12 def self.config_option( name, default ) define_method( "#{name}=" ) do | value | old_value = self.send( name ) if old_value.is_a?(String) && Skr::Core.logger Skr::Core.logger.info "Config option #{name} changed from #{old_value} to #{value}" end instance_variable_set( "@#{name}", value ) end attr_reader_with_default( name, default ) end |