Skip to content

Instantly share code, notes, and snippets.

@andyjeffries
Created May 18, 2009 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyjeffries/113477 to your computer and use it in GitHub Desktop.
Save andyjeffries/113477 to your computer and use it in GitHub Desktop.
class IO
def encrypted_read(filename)
puts filename
end
alias_method :non_encrypted_read, :read
alias_method :read, :encrypted_read
end
#>> IO.read('a')
#Errno::ENOENT: No such file or directory - a
# from (irb):35:in `read'
# from (irb):35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment