Class: Schked::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/schked/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject



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

Returns:

  • (Boolean)


13
14
15
# File 'lib/schked/config.rb', line 13

def logger?
  !!@logger
end

#pathsObject



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