Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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