Class: Module

Inherits:
Object show all
Defined in:
lib/multiarray.rb

Overview

Module#alias_method_chain is defined.

Instance Method Summary collapse

Instance Method Details

#alias_method_chain(target, feature, vocalize = target) ⇒ Module

Method for creating alias chains

Parameters:

  • target (Symbol, String)

    Method to rename.

  • feature (Symbol, String)

    Feature to use for renaming.

  • vocalize (Symbol, String) (defaults to: target)

    Override to use when renaming operators.

Returns:

  • (Module)

    Returns this module.



33
34
35
36
# File 'lib/multiarray.rb', line 33

def alias_method_chain( target, feature, vocalize = target )
  alias_method "#{vocalize}_without_#{feature}", target
  alias_method target, "#{vocalize}_with_#{feature}"
end