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

Represents a Method implementation in a Multimethod.

A Method is bound to a Module using a unique implementation name for the Multimethod.

A Multimethod may have multiple implementation Methods.

The Multimethod is responsible for determining the correct Method based on the relative scoring of the Method Signature.

Methods

Attributes

impl_name  [RW]  The Method’s underlying method name. This method name is unique.
multimethod  [RW]  The Method’s Multimethod.
signature  [RW]  The Method’s Signature used for relative scoring of applicability to an argument list.

Public Class methods

Initialize a new Method.

  Method.new(impl_name, signature)
  Method.new(impl_name, mod, name, parameter_list)

Public Instance methods

Returns 0.

Same as to_s.

Returns true if this Method matches the Signature.

Parameters

Remove the method implementation from the receiver Module.

Score of this Method based on the argument types. The receiver type is the first element of args.

Score this Method based on the argument types using a cache.

Returns a string representing the Ruby parameters.

Returns the "def foo(…)" string using the implementation name by default.

Returns a ruby signature using the implementation name by default.

Returns a string representation using the implementation name.

[Validate]