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

Represents a Multimethod.

A Multimethod has multiple implementations of a method based on the relative scoring of the argument types of the message.

A Multimethod has a name.

Methods

Attributes

debug  [RW]  Enable debugging info.
method  [RW]  A list of Method’s that implement this Multimethod.
name  [RW]  The Multimethod’s name.
table  [RW]  The Multimethod::Table that owns this Multimethod.

Public Class methods

Public Instance methods

Adds the new Method object to this Multimethod.

Returns a list of all Methods that match the Signature.

Generates a unique symbol for a method name. Method implementations will use a unique name for the implementation method. For example, for a Multimethod named "foo", the Method name might be "_multimethod_12_foo".

Installs a dispatching method in the Module. This method will dispatch to the Multimethod for Method lookup and application.

Returns true if this Multimethod matches the Signature.

Creates a new Method object bound to mod by name.

Removes the dispatching method in the Module.

Removes the method.

Returns a sorted list of scores and Methods that match the argument types.

[Validate]