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

Inherits:
DSL
  • Object
show all
Defined in:
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.



163
164
165
166
# File 'lib/logging/config/configurator.rb', line 163

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



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

def __appenders() @appenders; end

#__loggersObject



181
# File 'lib/logging/config/configurator.rb', line 181

def __loggers() @loggers; end

#__pre_configObject



180
# File 'lib/logging/config/configurator.rb', line 180

def __pre_config() __hash[:preconfig]; end

#appender(name, &block) ⇒ Object



176
177
178
# File 'lib/logging/config/configurator.rb', line 176

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

#logger(name, &block) ⇒ Object



172
173
174
# File 'lib/logging/config/configurator.rb', line 172

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

#pre_config(&block) ⇒ Object



168
169
170
# File 'lib/logging/config/configurator.rb', line 168

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