>> Logger.constants.each {|i| puts "Logger::#{i} = " + eval("Logger::#{i}").to_s}
Logger::VERSION = 1.2.7
Logger::ProgName = logger.rb/31641
Logger::Error = Logger::Error
Logger::ShiftingError = Logger::ShiftingError
Logger::Severity = Logger::Severity
Logger::SEV_LABEL = ["DEBUG", "INFO", "WARN", "ERROR", "FATAL", "ANY"]
Logger::Formatter = Logger::Formatter
Logger::LogDevice = Logger::LogDevice
Logger::Application = Logger::Application
Logger::SimpleFormatter = Logger::SimpleFormatter
Logger::DEBUG = 0
Logger::INFO = 1
Logger::WARN = 2
Logger::ERROR = 3
Logger::FATAL = 4
Logger::UNKNOWN = 5
Attention SPAMMERS: Don't advertise your services on my blog. If you do then you will have implicitly given me permission to disable any service you advertise via my blog by any means necessary.
Friday, April 5, 2013
Ruby String Interpolation
Use a combination of the eval command and the #{ } idiom to get the values of Logger constants.
Sponsor Ads (Please visit one if you liked this article. Thanks!)
Subscribe to:
Post Comments (Atom)
Nice Articles!
ReplyDeleteGreat moments of this articles!
Im surprised! Keep posting dude!
Read More:
* Download Film Minions 3 (Subtitle Indonesia) 2015
* Download Yakuza Apocalypse Subtitle Indo (2015)
* Download Film Terminator Genisys 2015 (Subtitle Indonesia)
* Download Film Insidious: Chapter 3 2015 (Subtitle Indonesia)
* Download Inside Out 2015 (Subtitle Indonesia) HD-RAY
* Download Jurassic World 2015 (Subtitle Indonesia)
* Film Korea Romantis Populer 2015