Skip to content

Instantly share code, notes, and snippets.

@ainoya
Created July 19, 2015 17:30
Show Gist options
  • Save ainoya/9141866245895c55d421 to your computer and use it in GitHub Desktop.
Save ainoya/9141866245895c55d421 to your computer and use it in GitHub Desktop.
wait
def wait? &block
i = 1
while i < 5 do
block.call(i)
sleep 0.2
i = i+1
end
end
a = wait? do |i|
puts "count #{i}"
end
puts a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment