ObjectSpace

ruby/spec describes 28 methods in core/objectspace, and Metorex implements 28 of them. The parameters are what Method#parameters answers under Metorex.

ObjectSpace#

  • ObjectSpace._id2ref: implemented, parameters [[:req, :id]].
  • ObjectSpace.count_objects: implemented, parameters [[:opt, :result]]. Counts all objects grouped by type. An example calling it.
  • ObjectSpace.define_finalizer: implemented, parameters [[:req, :held], [:opt, :callable], [:block, :block]]. Adds aProc as a finalizer, to be called after obj was destroyed. An example calling it.
  • ObjectSpace.each_object: implemented, parameters [[:opt, :wanted]]. Calls the block once for each living, nonimmediate object in this Ruby process. An example calling it.
  • ObjectSpace.garbage_collect: implemented, parameters [[:req, :args]]. Alias of GC.start
  • ObjectSpace.undefine_finalizer: implemented, parameters [[:req, :held]]. Removes all finalizers for obj.

ObjectSpace::WeakKeyMap#

  • ObjectSpace::WeakKeyMap#[]: implemented, parameters [[:req, :key]]. Returns the value associated with the given key if found.
  • ObjectSpace::WeakKeyMap#[]=: implemented, parameters [[:req, :key], [:req, :value]]. Associates the given value with the given key
  • ObjectSpace::WeakKeyMap#clear: implemented, parameters []. Removes all map entries; returns self. An example calling it.
  • ObjectSpace::WeakKeyMap#delete: implemented, parameters [[:req, :key]]. Deletes the entry for the given key and returns its associated value. An example calling it.
  • ObjectSpace::WeakKeyMap#getkey: implemented, parameters [[:req, :key]]. Returns the existing equal key if it exists, otherwise returns nil. An example calling it.
  • ObjectSpace::WeakKeyMap#inspect: implemented, parameters []. Returns a new String containing informations about the map: An example calling it.
  • ObjectSpace::WeakKeyMap#key?: implemented, parameters [[:req, :key]]. Returns true if key is a key in self, otherwise false. An example calling it.

ObjectSpace::WeakMap#

  • ObjectSpace::WeakMap#[]: implemented, parameters [[:req, :key]]. Returns the value associated with the given key if found.
  • ObjectSpace::WeakMap#[]=: implemented, parameters [[:req, :key], [:req, :value]]. Associates the given value with the given key.
  • ObjectSpace::WeakMap#delete: implemented, parameters [[:req, :key]]. Deletes the entry for the given key and returns its associated value. An example calling it.
  • ObjectSpace::WeakMap#each: implemented, parameters []. Iterates over keys and values. An example calling it.
  • ObjectSpace::WeakMap#each_key: implemented, parameters []. Iterates over keys. An example calling it.
  • ObjectSpace::WeakMap#each_pair: implemented, parameters [[:block, :block]]. Iterates over keys and values. An example calling it.
  • ObjectSpace::WeakMap#each_value: implemented, parameters []. Iterates over values. An example calling it.
  • ObjectSpace::WeakMap#include?: implemented, parameters [[:req, :key]]. Returns true if key is a key in self, otherwise false. An example calling it.
  • ObjectSpace::WeakMap#inspect: implemented, parameters []. An example calling it.
  • ObjectSpace::WeakMap#key?: implemented, parameters [[:req, :key]]. Returns true if key is a key in self, otherwise false. An example calling it.
  • ObjectSpace::WeakMap#keys: implemented, parameters []. Returns a new Array containing all keys in the map. An example calling it.
  • ObjectSpace::WeakMap#length: implemented, parameters []. Returns the number of referenced objects An example calling it.
  • ObjectSpace::WeakMap#member?: implemented, parameters [[:req, :key]]. Returns true if key is a key in self, otherwise false. An example calling it.
  • ObjectSpace::WeakMap#size: implemented, parameters []. Returns the number of referenced objects An example calling it.
  • ObjectSpace::WeakMap#values: implemented, parameters []. Returns a new Array containing all values in the map. An example calling it.

The method summaries are the first sentences of Ruby's own documentation for each method, read from MRI 4.0.6's ri data. Ruby's documentation is distributed under Ruby's license.