add break condition in ruby example