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
 

You know you’re a Java Programmer… « OLM On Rails said:

Pingback from  You know you’re a Java Programmer… « OLM On Rails

July 25, 2008 6:06 PM
 

extend???include??????????????? | ????????? said:

Pingback from  extend???include??????????????? | ?????????

March 20, 2009 1:10 AM
 

extend???include??????????????? said:

Pingback from  extend???include???????????????

June 16, 2009 1:52 AM
 

dark under eye said:

Pingback from  dark under eye

March 10, 2011 7:16 PM
 

Traffic Travis 4 Review said:

Pingback from  Traffic Travis 4 Review

April 18, 2011 7:10 PM

Leave a Comment

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