Skip to content

Instantly share code, notes, and snippets.

@flanger001
Last active May 24, 2017 18:54
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 flanger001/d49f798122cbf422a9290aa8c9194b0f to your computer and use it in GitHub Desktop.
Save flanger001/d49f798122cbf422a9290aa8c9194b0f to your computer and use it in GitHub Desktop.
class A
def foo
'hello'
end
alias_method :bar, :foo
end
class B < A
def foo
'bye'
end
end
x = B.new
x.bar # I would expect this to be "bye"
# But it is "hello"
## HOWEVER
class B < A
def foo
'bye'
end
alias_method :bar, :foo
end
x = B.new
x.bar # "bye"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment