Created
January 4, 2011 10:28
-
-
Save slawosz/764622 to your computer and use it in GitHub Desktop.
Chcecking hierarchy in ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Foo | |
def foo | |
begin | |
super | |
p 'foo!' | |
rescue | |
p 'foo' | |
end | |
end | |
end | |
class SuperBar | |
def foo | |
p 'super foo' | |
end | |
end | |
class Bar < SuperBar | |
include Foo | |
def foo | |
super | |
p 'bar' | |
end | |
end | |
Bar.new.foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment