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