ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-talk
ruby-talk
Re: instance_eval/class_eval including/extending modules
by Dave Thomas other posts by this author
Aug 31 2008 8:28PM messages near this date
Re: instance_eval/class_eval including/extending modules | Re: instance_eval/class_eval including/extending modules
On Aug 31, 2008, at 9:50 PM, Patrick Li wrote:

>  5)
>  include myModule <-- evaluates the instructions in myModule,  
>  underneath
>  selfClass
> 
>  6)
>  extend myModule <-- evaluates the instructions in myModule, underneath
>  self
> 
>  Does that seem correct now? Thanks for your help by the way. That's
>  quite a bit more clear n

No evaluation takes place. The module is already "compiled", and Ruby  
simply links a proxy for that module in to the parent class chain for  
either the class or metaclass. That way, module functionality is  
shared between multiple classes/objects that include/extend the module.


Dave
Thread:
Pedro Silva
David A. Black
Pedro Silva
David A. Black
Pedro Silva
David A. Black
Pedro Silva
Patrick Li
botp
Dave Thomas
Patrick Li
Dave Thomas
Patrick Li

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved