这是我的程序:
my_hash.each |w| do
p "is this right?"
awesome_print w
fix = gets
fix.chop
if (fix == "N")
p "Tell me what it should be"
correction = gets
w[1] = correction
end
end
这是我得到的错误:
what.rb:1: syntax error, unexpected keyword_do_block
what.rb:12: syntax error, unexpected keyword_end, expecting $end
有人知道我为什么会收到这个错误吗?
这是我的哈希:
{:banana=>:fruit, :pear=>:fruit, :sandal=>:fruit, :panda=>:fruit, :apple=>:fruit}
我只想以传统的 Ruby 方式对每个单独的密钥对进行操作。我怎么做?