Skip to content

Instantly share code, notes, and snippets.

@twerth
Created March 9, 2012 22:56
Show Gist options
  • Save twerth/2009160 to your computer and use it in GitHub Desktop.
Save twerth/2009160 to your computer and use it in GitHub Desktop.
>> class Foo
>> def bar
>> puts 'in bar'
>> end
>> end
=> nil
>> class Foo2 < Foo
>> def bar
>> super
>> puts 'in bar in foo2'
>> end
>> end
=> nil
>> f = Foo.new
=> #<Foo:0x007fc85110c068>
>> f.bar
in bar
=> nil
>> f2 = Foo2.new
=> #<Foo2:0x007fc8511026a8>
>> f.bar
in bar
=> nil
>> f2.bar
in bar
in bar in foo2
=> nil
>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment