阅读背景:

如何在Ruby中别名初始化方法?

来源:互联网 

I feel it is weird to create an object by calling "new", but in class definition the initializer is called "initialize". I tried to make it consistent(to be called "new" in both class definition and outside) so I tried the code below using alias_method:I feel it is weird to create an object by calli




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: