[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Exposing Ancestor Public Methods/ Book Reccomendation

Demonic Software

3/17/2008 2:11:00 PM

[Note: parts of this message were removed to make it a legal post.]

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.

2 Answers

Avdi Grimm

3/17/2008 2:16:00 PM

0

On Mon, Mar 17, 2008 at 10:11 AM, Demonic Software
<demonic.software@gmail.com> 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 Fulton.

--
Avdi

ermitano

6/28/2010 1:46:00 AM

0

On 27 jun, 21:36, Musicman59 <cwestbro...@gmail.com> wrote:
> On Jun 25, 6:09 pm, "Dimitrios Paskoudniakis" <greek...@yeahright.com>
> wrote:
>
>
>
>
>
> > "Musicman59" <cwestbro...@gmail.com> wrote in message
>
> >news:f8117fe2-d4be-43fc-b617-3d6697b85b97@d8g2000yqf.googlegroups.com...
>
> > > He traveled with a real band, That, etc,  for the Wings at the Speed
> > > of Sound Tour.
> > > Did he go all electronic after that?
>
> > > Craig
>
> > There was never a "Wings at the Speed of Sound Tour".  There was a 1975-1976
> > "Wings Over The World" Tour.  This included the core of Wings, plus four
> > brass and woodwind players: Howie Casey, Steve Howard, Thaddeus Richard, and
> > Tony Dorsey.
>
> > No other Wings or Paul McCartney tour ever featured additional musicians,
> > before or after the 1975-1976 tour.  So it was "all electronic" for the
> > prior 3 tours as well as the one subsequent Wings tour, and all subsequent
> > Paul McCartney tours.
>
> yeah, I got the tour name wrong.  tyoing at work, trying not to get
> caught, etc.  came close though...
>
> Craig- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

now his band is very small, 1 keyboard player who sometimes plays
percussion, 1 drummer, 1 lead guitar player, 1 rhythm guitar player
who sometimes plays bass and Paul on lead vocals, bass, guitar, piano
or even mandolin. only 5 guys, and as usually, there's no back up
singers, never a female choir, all the guys in the band doing vocals,
specially the drummer.