Class: Logging::Config::Configurator::TopLevelDSL

Inherits:
DSL
  • Object
show all
Defined in:
lib/gems/logging-0.9.4/lib/logging/config/configurator.rb

Instance Method Summary collapse

Methods inherited from DSL

#__hash, #__store, #method_missing, process

Constructor Details

#initializeTopLevelDSL

Returns a new instance of TopLevelDSL.



165
166
167
168
# File 'lib/gems/logging-0.9.4/lib/logging/config/configurator.rb', line 165

def initialize
  @loggers = []
  @appenders = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Logging::Config::Configurator::DSL

Instance Method Details

#__appendersObject



184
# File 'lib/gems/logging-0.9.4/lib/logging/config/configurator.rb', line 184

def __appenders() @appenders; end

#__loggersObject



183
# File 'lib/gems/logging-0.9.4/lib/logging/config/configurator.rb', line 183

def __loggers() @loggers; end

#__pre_configObject



182
# File 'lib/gems/logging-0.9.4/lib/logging/config/configurator.rb', line 182

def __pre_config() __hash[:preconfig]; end

#appender(name, &block) ⇒ Object



178
179
180
# File 'lib/gems/logging-0.9.4/lib/logging/config/configurator.rb', line 178

def appender( name, &block )
  @appenders << [name, DSL.process(&block)]
end

#logger(name, &block) ⇒ Object



174
175
176
# File 'lib/gems/logging-0.9.4/lib/logging/config/configurator.rb', line 174

def logger( name, &block )
  @loggers << [name, DSL.process(&block)]
end

#pre_config(&block) ⇒ Object



170
171
172
# File 'lib/gems/logging-0.9.4/lib/logging/config/configurator.rb', line 170

def pre_config( &block )
  __store(:preconfig, DSL.process(&block))
end