Module: Corefines::Module::AliasClassMethod

Defined in:
lib/corefines/module.rb

Instance Method Summary collapse

Instance Method Details

#alias_class_method(new_name, old_name) ⇒ self

Makes new_name a new copy of the class method old_name.

Parameters:

  • new_name (Symbol)

    name of the new class method to create.

  • old_name (Symbol)

    name of the existing class method to alias.

Returns:

  • (self)

13
14
15
16
17
18
19
20
# File 'lib/corefines/module.rb', line 13

module AliasClassMethod
  refine ::Module do
    def alias_class_method(new_name, old_name)
      singleton_class.__send__(:alias_method, new_name, old_name)
      self
    end
  end
end