Created
March 20, 2012 04:59
-
-
Save patrickgombert/2131521 to your computer and use it in GitHub Desktop.
ISP
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
class Reader | |
def read | |
file = File.new("readfile.rb", "r") | |
return file.gets | |
end | |
end | |
class Writer | |
def write(chars) | |
file = File.new("readfile.rb", "w") | |
file.puts chars | |
end | |
end | |
def copy(reader, writer) | |
chars = reader.read | |
writer.write(chars) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment