Last Updated: February 25, 2016
·
491
· yaodong

Ruby alias and alias_method

alias is a keyword and it is lexically scoped. It means it treats self as the value of self at the time the source code was read.

alias_method is a method defined in class Module that treats self as the value determined at the run time. it can be overridden later to offers more flexibility.

Further reading