# Passing Proc as a parameter

**URL:** <https://www.ruby-forum.com/t/passing-proc-as-a-parameter/79189>\
**Category:** Ruby\
**Created:** [December 13, 2006, 1:00am UTC](https://www.ruby-forum.com/t/passing-proc-as-a-parameter/79189 "2006-12-13T01:00:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cannac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@cannac](https://www.ruby-forum.com/u/cannac)\
**Post date:** [December 13, 2006, 1:00am UTC](https://www.ruby-forum.com/t/passing-proc-as-a-parameter/79189/1 "2006-12-13T01:00:22Z")

</div>

Hi,  
I’m a new user of Ruby, and trying to learn its features. But I have a  
difficulty to understand Proc class.  
What will be the referencing environment when we pass Proc as a  
parameter?  
and other question, how can we pass Proc as a parameter, can you give an  
example of it?  
Thanks for your help.

---

<div class="post-metadata">

**Author:** ![cannac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@cannac](https://www.ruby-forum.com/u/cannac)\
**Post date:** [December 13, 2006, 1:51am UTC](https://www.ruby-forum.com/t/passing-proc-as-a-parameter/79189/2 "2006-12-13T01:51:20Z")

</div>

Pretty good explanation at this blog:

[http://eli.thegreenplace.net/2006/04/18/understanding-ruby-blocks-procs-and-methods](http://eli.thegreenplace.net/2006/04/18/understanding-ruby-blocks-procs-and-methods)

---

<div class="post-metadata">

**Author:** ![cannac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@cannac](https://www.ruby-forum.com/u/cannac)\
**Post date:** [December 13, 2006, 2:18am UTC](https://www.ruby-forum.com/t/passing-proc-as-a-parameter/79189/3 "2006-12-13T02:18:23Z")

</div>

Thanks for the link, it really helped me to understand the topic.

---

<div class="post-metadata">

**Author:** ![cannac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/3be4f8/32.png) [@cannac](https://www.ruby-forum.com/u/cannac)\
**Post date:** [December 13, 2006, 2:27am UTC](https://www.ruby-forum.com/t/passing-proc-as-a-parameter/79189/4 "2006-12-13T02:27:23Z")

</div>

On Dec 12, 2006, at 6:00 PM, Can Ceran wrote:

> Hi,  
> I’m a new user of Ruby, and trying to learn its features. But I have a  
> difficulty to understand Proc class.  
> What will be the referencing environment when we pass Proc as a  
> parameter?  
> and other question, how can we pass Proc as a parameter, can you  
> give an  
> example of it?

This article might be worth a read:

[http://blog.grayproductions.net/articles/2006/01/05/code-as-a-data-type](http://blog.grayproductions.net/articles/2006/01/05/code-as-a-data-type)

James Edward G. II
