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: Where is attr_accessor located?
by Mauricio Fernandez other posts by this author
Nov 12 2006 3:24PM messages near this date
Re: Where is attr_accessor located? | Re: Where is attr_accessor located?
On Mon, Nov 13, 2006 at 06:16:05AM +0900, Mariano Kamp wrote:
>  On Nov 12, 2006, at 8:00 PM, Ross Bamford wrote:
>  
>  >>After looking at the rdoc documentation I would have assumed that  
>  >>attr_accessor would be a private method of Module, not of Kernel.
>  >>
>  >
>  >It's because:
>  >
>  >Kernel.is_a?(Module)
>  ># => true
>  >
>  >and the attr* methods are instance methods on Module.
>  
>  Yes, I _believe_ I understood that. It is "used" there.
>  Maybe that is what I don't get ... Why doesn't the method show up in  
>  Module?

Module.is_a? Class                                             # =>  true
Class.private_instance_methods(false).include? "attr_reader"   # =>  false
Kernel.is_a? Module                                            # =>  true
Module.private_instance_methods(false).include? "attr_reader"  # =>  true


-- 
Mauricio Fernandez  -   http://eigenclass.org   -  singular Ruby
Thread:
Mariano Kamp
Ross Bamford
Mariano Kamp
Mauricio Fernandez
Mariano Kamp

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