Class: Dobby::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/dobby/configuration.rb

Overview

Gem configuration.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



37
38
39
# File 'lib/dobby/configuration.rb', line 37

def initialize
  self.class.defaults.each_pair { |k, v| send("#{k}=", v) }
end

Instance Attribute Details

#loggerObject

Callbacks

def on_failure(&block) if block_given? @on_failure = block else @on_failure end end

attr_writer :on_failure



56
57
58
# File 'lib/dobby/configuration.rb', line 56

def logger
  @logger
end

Class Method Details

.default_loggerObject



27
28
29
30
31
# File 'lib/dobby/configuration.rb', line 27

def self.default_logger
  logger = Logger.new(STDOUT)
  logger.progname = 'dobby'
  logger
end

.defaultsObject



33
34
35
# File 'lib/dobby/configuration.rb', line 33

def self.defaults
  @defaults ||= {}
end