Module: Weak

Defined in:
lib/weak.rb,
lib/weak/map.rb,
lib/weak/set.rb,
lib/weak/version.rb,
lib/weak/map/deletable.rb,
lib/weak/map/weak_keys.rb,
lib/weak/set/weak_keys.rb,
lib/weak/map/strong_keys.rb,
lib/weak/set/strong_keys.rb,
lib/weak/map/abstract_strong_keys.rb,
lib/weak/map/strong_secondary_keys.rb,
lib/weak/map/weak_keys_with_delete.rb,
lib/weak/set/strong_secondary_keys.rb,
lib/weak/set/weak_keys_with_delete.rb
more...

Overview

Weak is a Ruby library which implements collections of unordered values without strong object references.

We provide multiple classes which behave similar to their standard-library counterparts. However, all elements are only weakly referenced. That way, all elements can be garbage collected and silently removed from the collection unless they are still referenced from some other live object.

Defined Under Namespace

Classes: Map, Set, UndefinedClass

Constant Summary collapse

UNDEFINED =

The UNDEFINED object can be used as the default value for method arguments to distinguish it from ‘nil`.

UndefinedClass.instance
VERSION =

The Weak version as a ‘Gem::Version` string. We follow semantic versioning.

"0.1.0"