Reputation: 1861
Could you please tell, what is the Ruby syntax for while block in one line?
while
Upvotes: 5
Views: 6566
Reputation: 10994
Simple:
while 1 do puts "hello" end
Upvotes: 4
Reputation: 20786
For example
puts a[i+=1] while i < 10
Upvotes: 17