# Rand

**URL:** <https://www.ruby-forum.com/t/rand/93413>\
**Category:** Ruby\
**Created:** [April 2, 2006, 4:46am UTC](https://www.ruby-forum.com/t/rand/93413 "2006-04-02T04:46:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![reversejt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@reversejt](https://www.ruby-forum.com/u/reversejt)\
**Post date:** [April 2, 2006, 4:46am UTC](https://www.ruby-forum.com/t/rand/93413/1 "2006-04-02T04:46:50Z")

</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:** ![reversejt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@reversejt](https://www.ruby-forum.com/u/reversejt)\
**Post date:** [April 2, 2006, 5:05am UTC](https://www.ruby-forum.com/t/rand/93413/2 "2006-04-02T05:05:22Z")

</div>

On 4/1/06, Jeff T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

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

_snip_

Looks like Kernel

pth

---

<div class="post-metadata">

**Author:** ![reversejt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@reversejt](https://www.ruby-forum.com/u/reversejt)\
**Post date:** [April 2, 2006, 5:35am UTC](https://www.ruby-forum.com/t/rand/93413/3 "2006-04-02T05:35:29Z")

</div>

Jeff T. 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  
rand(max=0) =\> number
