Created
August 2, 2012 12:12
-
-
Save rvanlieshout/3236611 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'singleton' | |
| class PhoneLogger | |
| include Singleton | |
| def self.set_file(logfile) | |
| PhoneLogger.instance.set_file(logfile) | |
| end | |
| def set_file(logfile) | |
| @logfile = logfile | |
| end | |
| def self.log(message) | |
| PhoneLogger.instance.log(message) | |
| end | |
| def log(message) | |
| # some magic here | |
| end | |
| end | |
| PhoneLogger.set_file File.open(...) | |
| PhoneLogger.log "hello world!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment