From: Robert Klemme Date: 2008-04-11T20:16:57+09:00 Subject: Re: how to create random object to a particular ruby object ? 2008/4/11, Pokkai Dokkai : > 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 Cheers robert -- use.inject do |as, often| as.you_can - without end