Skip to content

Instantly share code, notes, and snippets.

@YusukeIwaki
Created July 9, 2018 07:14
Show Gist options
  • Save YusukeIwaki/2d53e12a90eee767d71905fd172f7aa9 to your computer and use it in GitHub Desktop.
Save YusukeIwaki/2d53e12a90eee767d71905fd172f7aa9 to your computer and use it in GitHub Desktop.
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