Thanks Joel,
Since I'm using the method in other classes I switched to sending in the
whole of myObj and then accessing the method. It's not pretty but it
gets the job done. The snippet below looks OK. I guess my code is only
a mess because the method I want to use is part of a larger class. If I
isolate the method I want the code will probably be cleaner.
Cheers,
Larry
class MethodWrapper
def myMethod
puts "command"
end
end
class OtherKlass
def initialize( methodWrapper )
methodWrapper.myMethod
end
end
myObj = MethodWrapper.new
otherObj = OtherKlass.new(myObj)
--
Posted via http://www.ruby-forum.com/.