Class Multimethod::Table
In: lib/multimethod/table.rb
Parent: Object

Represents a Multimethod repository.

There is typically only one instance.

It provides the interface to the core extensions.

Methods

Attributes

debug  [RW]  Enable debugging info.
multimethod  [RW]  A list of all Multimethod objects.

Public Class methods

Returns the current instance or creates a new one.

Creates a new Table object.

Public Instance methods

Dispatches to the appropriate Method based on name, receiver and arguments.

Returns a list of all the Methods that match a signature.

The signature can be a String, Method or Signature object.

Returns the Multimethods that matches a signature. The signature can be a String, Method or Signature object.

Installs a new Multimethod Method using the multimethod syntax:

   class A
     multimethod q{
       def foo(x)
         ...
       end
     }
     multimethod q{
       def foo(A x)
       end
     }
   end

Interface to Multimethod::Module mixin multimethod

Returns a Multimethod object for a method name.

Will create a new Multimethod if needed.

Returns the object for name, using the appropriate evaluation scope.

Removed the Method that match a signature.

The signature can be a String, Method or Signature object.

Raises an error if more than one Method is found.

[Validate]