Skip to content

Instantly share code, notes, and snippets.

@patrickgombert
Created March 20, 2012 04:59
Show Gist options
  • Save patrickgombert/2131521 to your computer and use it in GitHub Desktop.
Save patrickgombert/2131521 to your computer and use it in GitHub Desktop.
ISP
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