You could simply to puts "#{lines.keys}"