Skip to content

Instantly share code, notes, and snippets.

@technicalpickles
Created March 7, 2011 12:53
Show Gist options
  • Save technicalpickles/858471 to your computer and use it in GitHub Desktop.
Save technicalpickles/858471 to your computer and use it in GitHub Desktop.
fun with super
ree-1.8.7-2010.02 :001 > class Foo; def bar; super; end; end
nil
ree-1.8.7-2010.02 :002 > Foo.new.bar
NoMethodError: super: no superclass method `bar' for #<Foo:0x101bc7120>
from (irb):1:in `bar'
from (irb):2
ree-1.8.7-2010.02 :003 > class Foo; def bar; super if defined?(super); end; end
nil
ree-1.8.7-2010.02 :004 > Foo.new.bar
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment