Skip to content

Instantly share code, notes, and snippets.

@Lordnibbler
Created February 1, 2014 01:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lordnibbler/8746548 to your computer and use it in GitHub Desktop.
Save Lordnibbler/8746548 to your computer and use it in GitHub Desktop.
puts 'Start'
numbers = []
def do_it_later(&b)
b
end
5.times do |i|
puts "adding: #{i}"
numbers << do_it_later { puts i }
end
puts 'gonna call them'
numbers.each { |x| x.call }
puts 'done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment