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

Cheers

robert


-- 
use.inject do |as, often| as.you_can - without end