Created
June 12, 2016 10:56
-
-
Save jarmo/6ada7519a657c47d146da852ad2c77d9 to your computer and use it in GitHub Desktop.
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
class A | |
def call | |
foo do | |
yield if block_given? | |
puts "a" | |
end | |
end | |
def foo | |
yield | |
puts "foo" | |
end | |
end | |
class B < A | |
def call | |
super do | |
yield if block_given? | |
puts "b" | |
end | |
end | |
end | |
class C < B | |
def call | |
super do | |
puts "c" | |
end | |
end | |
end | |
A.new.call | |
puts "A" | |
B.new.call | |
puts "B" | |
C.new.call | |
puts "C" |
Author
jarmo
commented
Jun 12, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment