Skip to content

Instantly share code, notes, and snippets.

@danielsdeleo
Created July 21, 2009 01:21
Show Gist options
  • Save danielsdeleo/151036 to your computer and use it in GitHub Desktop.
Save danielsdeleo/151036 to your computer and use it in GitHub Desktop.
class A
def test
p "whatup from A"
end
end
# => nil
module B
def test
p "whatup from B"
super
end
end
# => nil
a = A.new
# => #<A:0x112ba78>
a.test
# "whatup from A"
# => nil
a.extend B
# => #<A:0x112ba78>
a.test
# "whatup from B"
# "whatup from A"
# => nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment