Skip to content

Instantly share code, notes, and snippets.

@svenfuchs
Created June 19, 2009 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save svenfuchs/132576 to your computer and use it in GitHub Desktop.
Save svenfuchs/132576 to your computer and use it in GitHub Desktop.
class A
def foo
puts 'original'
end
alias bar foo
def foo
puts 'modified'
end
end
A.new.bar # => "original"
# -------------------------------------
class A
def foo
puts 'original'
end
end
class B < A
alias bar foo
end
class A
def foo
puts 'modified'
end
end
B.new.bar # => "original"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment