Last active
October 14, 2015 17:26
-
-
Save graingert/269b72e119428e53b8b3 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 Foo | |
def handle(obj) | |
yield obj | |
end | |
end | |
class Bar < Foo | |
def handle(obj) | |
super { | a | yield a.downcase } | |
end | |
end | |
Foo.new.handle('HELLO'){ | a | puts a; } # HELLO | |
Bar.new.handle('HELLO'){ | b | puts b; } # expects hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment