Skip to content

Instantly share code, notes, and snippets.

@makimoto
Created June 3, 2012 05:18
Show Gist options
  • Save makimoto/2862023 to your computer and use it in GitHub Desktop.
Save makimoto/2862023 to your computer and use it in GitHub Desktop.
[1] pry(main)> a = (0...10).lazy.map{|m| puts 'sushi'; m }
=> #<Enumerator::Lazy: ...>
[2] pry(main)> a.force
sushi
sushi
sushi
sushi
sushi
sushi
sushi
sushi
sushi
sushi
=> [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