From: Calamitas Date: 2008-02-26T23:52:53+09:00 Subject: Re: # arguments to rand On 26/02/2008, d c wrote: > hi - > > can someone help with suggesting what is wrong below? i am trying to > add a simple method to array#random > > but get the wrong number of args error... > have tried lots of variations! > > >> class Array > >> def random > >> n = rand(self.size.to_i) You are probably calling Array#rand as defined by Rails. If so, it does what your Array#random is supposed to do and you can use it directly. Otherwise you can call Kernel.rand instead of just rand. Peter