I was looking at the Ruby logging library Logging.logger method and have a question from the source at github relating to this piece of code:
logger = ::Logging::Logger.new(name)
logger.add_appenders appender
logger.additive = false
class << logger
def close
@appenders.each {|a| a.close}
h = ::Logging::Repository.instance.instance_variable_get :@h
h.delete(@name)
class << self; undef :close; end
end
end
I understand that the class << logger opens up the eigen/meta/singleton class to the logger object to add an instance specifice close method. However, I am not exactly sure what the "class << self; undef :close; end" does and for what purpose. Can anyone tell me what it means?