Skip to content

Instantly share code, notes, and snippets.

@cdollins
Last active December 30, 2015 08:09
Show Gist options
  • Save cdollins/7800539 to your computer and use it in GitHub Desktop.
Save cdollins/7800539 to your computer and use it in GitHub Desktop.
Super!
class A
def initialize
p "Hello"
end
end
class B < A
def initialize
p "Fellow"
end
end
class C < A
def initialize
super
p "Fellow"
end
end
####IRB SESSION###
> A.new
"Hello"
> B.new
"Fellow"
> C.new
"Hello"
"Fellow"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment