1
人照顾设定值来解释为什么我在这里得到一个错误:红宝石 - 在哈希
[~]$ irb
>> h = Hash
=> Hash
>> h["a"] = 100
NoMethodError: undefined method `[]=' for Hash:Class
from (irb):2
但不是在这里:
>> h = {'dog' => 'canine'}
=> {"dog"=>"canine"}
>> h["a"] = 100
=> 100