Class: Module

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-util/command/cocoapods-extend/repo/push_helper.rb

Instance Method Summary collapse

Instance Method Details

#strong_alias(to, from) ⇒ Object



2
3
4
5
6
7
# File 'lib/cocoapods-util/command/cocoapods-extend/repo/push_helper.rb', line 2

def strong_alias(to, from)
  # https://tieba.baidu.com/p/5535445605?red_tag=0735709674  贴吧大神给出的方案
  # 类方法可以看做singleton class(单例类)的实例方法,下面两个方法都可以,上面这个方式也适用于早起的ruby版本
  (class << self;self;end).send(:alias_method, to, from)
  # self.singleton_class.send(:alias_method, to, from)
end