From: Kyle Schmitt Date: 2007-07-27T04:39:39+09:00 Subject: Re: Class variables and how to set them up only once. Right, so the way I wrote previously, or this way: def setupLogger(path="c:\\#{DateTime.now.to_s.gsub(':','-')}.xml") unless self.class.class_variables.include?"@@logger" puts "I'm setting up the logger, you should only see me once" @@logger=File.new("c:\\#{DateTime.now.to_s.gsub(':','-')}.xml","w") @@logger.puts "" @loggerSetup=true end end