Skip to content
instance method

ObjectSpace::WeakKeyMap#[]=

(Key, Value?) -> Value?
map[key] = value → value

Associates the given value with the given key

The reference to key is weak, so when there is no other reference to key it may be garbage collected.

If the given key exists, replaces its value with the given value; the ordering is not affected

See also #[] #clear #delete also in 4.1 · 3.4 · 3.3