Created
June 2, 2020 17:23
-
-
Save simandebvu/3edc73eb9f6a666cf1594ad27a67edb9 to your computer and use it in GitHub Desktop.
Ruby Block Call
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 my_awesome_method ("Param1", &block) | |
| return to_enum(:each) unless block | |
| i = 0 | |
| while i < size: | |
| block.call at (i) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment