# Rand

**URL:** <https://rubytalk.org/t/rand/26350>\
**Category:** ruby-talk\
**Created:** [2 April 2006 02:45 UTC](https://rubytalk.org/t/rand/26350 "2006-04-02T02:45:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Thorne](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@Jeff\_Thorne](https://rubytalk.org/u/Jeff_Thorne)\
**Post date:** [2 April 2006 02:45 UTC](https://rubytalk.org/t/rand/26350/1 "2006-04-02T02:45:47Z")

</div>

I have been searching through the ruby doc trying to find out which class  
the method rand belongs to as I need to find out how to pass in a range as a  
parameter?

Does anyone know which class rand belongs too?

Thanks,  
Jeff

---

<div class="post-metadata">

**Author:** ![Patrick\_Hurley1](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Patrick\_Hurley1](https://rubytalk.org/u/Patrick_Hurley1)\
**Post date:** [2 April 2006 03:03 UTC](https://rubytalk.org/t/rand/26350/2 "2006-04-02T03:03:19Z")

</div>

ri rand  
------------------------------------------------------------ Kernel#rand  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rand(max=0) =\> number

> **···**
>
> On 4/1/06, Jeff Thorne \<jeff\_thorne@yahoo.com\> wrote:
> 
> > I have been searching through the ruby doc trying to find out which class  
> > the method rand belongs to as I need to find out how to pass in a range as a  
> > parameter?
> > 
> > Does anyone know which class rand belongs too?
> > 
> > Thanks,  
> > Jeff
> 
> ------------------------------------------------------------------------  
> \*snip\*
> 
> Looks like Kernel
> 
> pth

---

<div class="post-metadata">

**Author:** ![Daniel\_Harple](https://avatars.discourse-cdn.com/v4/letter/d/5daacb/32.png) [@Daniel\_Harple](https://rubytalk.org/u/Daniel_Harple)\
**Post date:** [2 April 2006 03:04 UTC](https://rubytalk.org/t/rand/26350/3 "2006-04-02T03:04:37Z")

</div>



---

<div class="post-metadata">

**Author:** ![Tim\_Hunter](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@Tim\_Hunter](https://rubytalk.org/u/Tim_Hunter)\
**Post date:** [2 April 2006 03:33 UTC](https://rubytalk.org/t/rand/26350/4 "2006-04-02T03:33:47Z")

</div>

Jeff Thorne wrote:

> I have been searching through the ruby doc trying to find out which class  
> the method rand belongs to as I need to find out how to pass in a range as a  
> parameter?
> 
> Does anyone know which class rand belongs too?

$ ri rand  
------------------------------------------------------------ Kernel#rand  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rand(max=0) =\> number

> **···**
>
> ------------------------------------------------------------------------
