Hello Guys,

I'm fairly new to ruby and I have a question:

I have an array:

$xarray = [10,10]

I have this method:

 def product

  inject(1) { |s, v| s *= v }

end#def



And I have a class:


class Test

     def initialize()

     tt= $xarray.product

     UI.messagebox tt


     end#def
end#class




I want to use the method 'product' in my class. How do I do that ??
Or more in general how do I define methods that I can use all through my
ruby script???

Thnx for your help..

-- 
Posted via http://www.ruby-forum.com/.