Skip to content

Instantly share code, notes, and snippets.

@alindeman
Created December 22, 2010 16:31
Show Gist options
  • Save alindeman/751726 to your computer and use it in GitHub Desktop.
Save alindeman/751726 to your computer and use it in GitHub Desktop.
actions = []
[1, 2, 3, 4, 5].each do |i|
actions.push lambda { puts i }
end
actions.each(&:call)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment