当尝试处理ruby中的嵌套散列时,我得到了这个错误:
undefined method `has_key' for {"_l"=>{"or"=>"@`"}, "a"=>{}}:Hash (NoMethodError)上面的'for‘不就是指的东西吗?哈希?哈希没有has_key?()方法吗?这里发生了什么事?
这是代码。谢谢:
$conditioning_environments = {
"_l" =>
{
"or" => "@`"
},
"a" => {
}
}
....
if $conditioning_environments["_"+graphemes[index+1]].has_key(g)
....发布于 2012-05-13 08:22:27
https://stackoverflow.com/questions/10568433
复制相似问题