Help ruby noob write a hitEnterToContinue() method

i = 0
@doc.traverse_text { |text|
puts "#{i}: " + text.to_s.strip + “\n”
i += 1
}

def hit_enter_to_continue
gets s
chomp
if( $_ == “x”)
break
end
end

On Jul 15, 2007, at 07:40 , David Lam wrote:

def hit_enter_to_continue
gets s
chomp
if( $_ == “x”)
break
end
end

Try using getch.