Created
July 9, 2018 07:14
-
-
Save YusukeIwaki/2d53e12a90eee767d71905fd172f7aa9 to your computer and use it in GitHub Desktop.
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
class Ten | |
include Enumerable | |
def initialize | |
end | |
def each(&block) | |
10.times.each(&block) | |
end | |
end | |
p Ten.new.map(&:to_s) | |
# => ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment