in

CodePrairie .NET

South Dakota .NET User Group

chrisortman

Ruby include and extend

Nice write up by Marc about ruby extend and include. He succinctly explains what each of the methods do, however I think his explanation is for a ruby programmer, not a C# programmer trying to learn more about ruby. Upon further research I found another post that made it quite clear for me.

The extend method will mix a module’s methods at the class level. The method defined in the Math module can be used as a class/static method.

The include method will mix a module’s methods at the instance level, meaning that the methods will become instance methods.

It is much easier for me to relate that to what I am familiar with in C#.

Published Jul 07 2007, 09:23 AM by chrisortman
Filed under:

Comments

 

Extending your include knowledge of Ruby « Marc-Andr?? Cournoyer’s blog said:

Pingback from  Extending your include knowledge of Ruby « Marc-Andr?? Cournoyer’s blog

July 7, 2007 7:36 PM

Leave a Comment

(required)  
(optional)
(required)  
Add
Powered by Community Server (Commercial Edition), by Telligent Systems