Method: Weak::Map#default=

Defined in:
lib/weak/map.rb

#default=(default_value) ⇒ Object

Sets the default value to default_value and clears the #default_proc; returns default_value.

Parameters:

  • default_value (Object)

    the new default value which will be returned when accessing a non-existing key

Returns:

  • (Object)

    the given default_value



389
390
391
392
# File 'lib/weak/map.rb', line 389

def default=(default_value)
  @default_proc = nil
  @default_value = default_value
end