Created
February 26, 2016 22:40
-
-
Save wied03/3cefd173459b076a2b1d 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 Foobar | |
def some_method(&block) | |
block['the_key', 'the_value'] | |
end | |
# def foobar(&block) | |
# block['foo key', 'foo value'] | |
# end | |
end | |
class Bar < Foobar | |
def some_method | |
super do |k, v| | |
# puts 'we ran properly, now yielding' | |
yield k, v | |
end | |
end | |
end | |
Bar.new.some_method do |k, v| | |
puts "original block key #{k} value #{v}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment