Created
January 1, 2015 01:45
-
-
Save meaganewaller/a84e7a4c971316f3bbd4 to your computer and use it in GitHub Desktop.
The Decorator Pattern
This file contains 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
w = SimpleWriter.new('out') | |
class << w | |
alias old_write_line write_line | |
def write_line(line) | |
old_write_line("#{Time.new}: #{line}") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment