class Fuli::Config
Attributes
instance[W]
error_notifiers[RW]
logger[RW]
warn_notifiers[RW]
Public Class Methods
instance()
click to toggle source
# File lib/fuli/config.rb, line 17 def instance @instance ||= new end
new(config_hash = {})
click to toggle source
# File lib/fuli/config.rb, line 7 def initialize(config_hash = {}) self.logger = config_hash[:logger] self.warn_notifiers = config_hash[:warn_notifiers] || [] self.error_notifiers = config_hash[:error_notifiers] || [] merge(config_hash) end
Private Instance Methods
merge(config_hash)
click to toggle source
# File lib/fuli/config.rb, line 24 def merge(config_hash) config_hash.each_pair(&method(:set_option)) self end
set_option(option, value)
click to toggle source
# File lib/fuli/config.rb, line 29 def set_option(option, value) __send__("#{option}=", value) rescue NoMethodError raise Fuli::Error, "unknown config option '#{option}'" end