On Monday 24 August 2009 05:12:44 pm Kostas L. wrote:
I want to make something like this:
a = A.new
Use modules or inheritance.
I this possible someway???
Not the way you’ve defined those classes. If B was either a superclass
of A, or
a module mixed into A, you could use unbound methods, but it’s not, so
I dont want to use modules.
This is exactly why modules exist – to solve exactly, precisely, the
Ask yourself this question: Do the methods you want out of B make any
all in A, or in any other class? If so, why not make it a module? If
may want to do some sort of delegation – that is:
@b = B.new
Does that answer your question?