2008/4/11, Robert Dober <robert.dober / gmail.com>: > On Fri, Apr 11, 2008 at 1:16 PM, Robert Klemme > <shortcutter / googlemail.com> wrote: > > 2008/4/11, Pokkai Dokkai <bad_good_lion / yahoo.com>: > > > > > how to create random object to a particular ruby object ? > > > > > > for example i want like this > > > > You need more input parameters: > > > > > rand(Fixnum) --> 345 (randomly) > > Number range? > > > > > > > rand(Float) --> 3877.5545(randomly) > > Number range? > > > > > rand(String) --> "sfskgksf" (randomly) > > Length of String? Chars allowed in String? > > > > > rand(boolean) --> 0(randomly) > > That's easy > > rand(2) == 0 > > I am surprised that you are so permissive Robert ;). I'm not getting the joke here, sorry. Is it somehow related to the original posting mentioning "0" as the sole return value from rand(boolean)? Cheers robert -- use.inject do |as, often| as.you_can - without end