Created
November 21, 2018 10:51
-
-
Save nsave/3623001cb3244f4faa0f7420ded7cdf0 to your computer and use it in GitHub Desktop.
Stop including Enumerable, return Enumerator instead (https://blog.arkency.com/2014/01/ruby-to-enum-for-enumerator/)
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 your_method_name_which_is_usually_each(*args) | |
| return enum_for(:your_method_name_which_is_usually_each, *args) unless block_given? | |
| # go crazy | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment