From: David Masover Date: 2009-08-25T09:48:35+09:00 Subject: Re: Calling method from another class On Monday 24 August 2009 05:12:44 pm Kostas Lps wrote: > I want to make something like this: > a = A.new > a.printB 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 you can't. > I dont want to use modules. Why not? This is exactly why modules exist -- to solve exactly, precisely, the problem you've outlined. Ask yourself this question: Do the methods you want out of B make any sense at all in A, or in any other class? If so, why not make it a module? If not, you may want to do some sort of delegation -- that is: class A def initialize @b = B.new end def printB @b.printB end end Does that answer your question?