First difference you will notice is that in case of alias_method we need to use a comma between the "new method name" and "old method name". alias_method takes both symbols and strings as input. Following code would also work:

With the usage of alias the method "name" is not able to pick the method "full_name" defined in Developer.

This is because 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. In contrast alias_method treats self as the value determined at the run time. Overall my recommendation would be to use alias_method. Since alias_method is a method defined in class Module it can be overridden later and it offers more flexibility.

You can create aliases for a method and variable name in ruby. This can be helpful if you want to override the behavior of some method without changing the origin implementation of it. alias_method take a new_name as a copy name of the old_name and it has the following syntax: