Class: Weak::Key

# Weak::Key (Class)

In: | lib/Borges/Utilities/WeakIdentityKeyHash.rb
Parent: | Object

A key for Weak::IdentityKeyHash that holds weakly on its contents.

## Methods

by_obj eql? get_obj hash inspect make_finalizer new

## Constants

ID_MAP | = | {}
| Map from an object to a list of its references
ID_REV_MAP | = | {}
| Map from a reference to its object

## Attributes

internal_id | [R] | The object being weakly held by this key.

## Classes and Modules

Class Weak::Key::IdentityKeyHash

## Public Class methods

by_obj(obj)

Retrives `obj`’s WeakKey reference.

make_finalizer(internal_id, hash_id)

Creates a finalizer for the object referenced by `internal_id` that removes that object from `hash`.

new(orig, hash)

Create a new WeakKey from `orig` that will remove itself from +hash+when it is no longer referenced.

## Public Instance methods

eql?(other)

A WeakKey is equal to `other` if `other` has the same internal_id or object_id.

get_obj()

Retrieves an object from its id.

hash()

A WeakKey’s hash is the held object’s object_id.

inspect()

Creates a string that represents the internal state of this object.

[Validate]