Created
October 21, 2020 02:20
-
-
Save flivni/2fcb1fd48b4edfcbc1ab24e69f779b65 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 bar | |
yield | |
puts 'after yield' | |
end | |
end | |
class ExecuteFoo | |
def initialize | |
@foo = Foo.new | |
end | |
def execute | |
@foo.bar do | |
return 'bar' # this returns early from the bar function skipping the "after yield" | |
end | |
end | |
end | |
ExecuteFoo.new.execute |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment