Created
October 23, 2024 18:01
-
-
Save Animesh-Ghosh/fffe5aa7432ce63b875db24e2f66f163 to your computer and use it in GitHub Desktop.
Ruby WTF
This file contains hidden or 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
| def foo | |
| return :bar | |
| ensure | |
| p :foo | |
| end | |
| foo # => :bar but prints :foo before returning | |
| def foo | |
| return :bar | |
| ensure | |
| return :baz | |
| end | |
| foo # => returns :baz ?!? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment