Class: Schked::Config
- Inherits:
-
Object
- Object
- Schked::Config
- Defined in:
- lib/schked/config.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #fire_callback(name, *args) ⇒ Object
- #logger? ⇒ Boolean
- #paths ⇒ Object
- #register_callback(name, &block) ⇒ Object
Instance Attribute Details
#logger ⇒ Object
17 18 19 |
# File 'lib/schked/config.rb', line 17 def logger @logger ||= Logger.new(STDOUT).tap { |l| l.level = Logger::INFO } end |
Instance Method Details
#fire_callback(name, *args) ⇒ Object
25 26 27 28 29 |
# File 'lib/schked/config.rb', line 25 def fire_callback(name, *args) callbacks[name].each do |callback| callback.call(*args) end end |
#logger? ⇒ Boolean
13 14 15 |
# File 'lib/schked/config.rb', line 13 def logger? !!@logger end |
#paths ⇒ Object
9 10 11 |
# File 'lib/schked/config.rb', line 9 def paths @paths ||= [] end |
#register_callback(name, &block) ⇒ Object
21 22 23 |
# File 'lib/schked/config.rb', line 21 def register_callback(name, &block) callbacks[name] << block end |