# Exposing Ancestor Public Methods/ Book Reccomendation

**URL:** <https://www.ruby-forum.com/t/exposing-ancestor-public-methods-book-reccomendation/132164>\
**Category:** Ruby\
**Created:** [March 17, 2008, 3:11pm UTC](https://www.ruby-forum.com/t/exposing-ancestor-public-methods-book-reccomendation/132164 "2008-03-17T15:11:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsoftware](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/82dd89/32.png) [@dsoftware](https://www.ruby-forum.com/u/dsoftware)\
**Post date:** [March 17, 2008, 3:11pm UTC](https://www.ruby-forum.com/t/exposing-ancestor-public-methods-book-reccomendation/132164/1 "2008-03-17T15:11:50Z")

</div>

Hello,

I am trying to access some attr\_accessor and public/protected methods  
from  
an inheriting class or module.

class Foo:  
def initialize(); end  
def some\_method():  
print “Foo are you?\n”  
end  
end

class Bar \< Foo  
class \<\< self; end  
def initialize(); end  
def another\_method()  
print “Bar am I”  
end  
end

If I do a Foo.public\_methods, it will list some\_method as one of those  
methods. I am trying to get Bar.public\_method to also list that  
inherited  
method.Is this possible?  
Is there also a way to force this inheritance with instance variables?  
Likewise I would like to do perform the same activities on modules, and  
is  
that possible (example below of how I am doing this)?

module Foo:  
def some\_method():  
print “Foo are you?\n”  
end  
end

class Bar \< Foo  
class \<\< self; end  
def initialize(); end  
def another\_method()  
print “Bar am I”  
end  
end

Also, is there book that speaks about the core aspects of Ruby  
programming,  
giving detailed Networking, thread programming, etc. Basically, I am  
looking for a general reference book that covers a wide range of areas  
in  
Ruby programming, which are accompanied by examples. Additionally, the  
topics do not need to cover Ruby on Rails. Thanks.

---

<div class="post-metadata">

**Author:** ![dsoftware](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/82dd89/32.png) [@dsoftware](https://www.ruby-forum.com/u/dsoftware)\
**Post date:** [March 17, 2008, 3:17pm UTC](https://www.ruby-forum.com/t/exposing-ancestor-public-methods-book-reccomendation/132164/2 "2008-03-17T15:17:11Z")

</div>

On Mon, Mar 17, 2008 at 10:11 AM, Demonic S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Also, is there book that speaks about the core aspects of Ruby programming,  
> giving detailed Networking, thread programming, etc. Basically, I am  
> looking for a general reference book that covers a wide range of areas in  
> Ruby programming, which are accompanied by examples. Additionally, the  
> topics do not need to cover Ruby on Rails. Thanks.

You need “The Ruby Way”, Second Edition, by Hal F…
