Class: Dobby::Configuration
- Inherits:
-
Object
- Object
- Dobby::Configuration
- Includes:
- Singleton
- Defined in:
- lib/dobby/configuration.rb
Overview
Gem configuration.
Instance Attribute Summary collapse
-
#logger ⇒ Object
Callbacks.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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
#logger ⇒ Object
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_logger ⇒ Object
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 |
.defaults ⇒ Object
33 34 35 |
# File 'lib/dobby/configuration.rb', line 33 def self.defaults @defaults ||= {} end |