Forum: Ruby instance_eval

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sachin Gadkar (Guest)
on 2007-01-09 14:50
(Received via mailing list)
Hi all,
I wanted to know the best place where I can find how instance_eval
works. I
also wanted to know how the implementation of .each { } in implemented
for
Array class.

I also need to say that I have been new to Ruby but old to OO
programming.

Thanks.

--
sachin.gadkar@gmail.com

URL : http://nichas143.tripod.com
unknown (Guest)
on 2007-01-09 15:11
(Received via mailing list)
Hi --

On Tue, 9 Jan 2007, Sachin Gadkar wrote:

> Hi all,
> I wanted to know the best place where I can find how instance_eval works. I

ri instance_eval

> also wanted to know how the implementation of .each { } in implemented for
> Array class.

It's defined in array.c.  It goes through the array and yields each
element in turn as it goes.


David
B4be024dc3171b83206171f3f75db122?d=identicon&s=25 Justin C. (justincollins)
on 2007-01-09 20:57
(Received via mailing list)
Sachin Gadkar wrote:
> Thanks.
>

Here is how Array#each is implemented:
http://ruby-doc.org/core/classes/Array.src/M002225.html

Here is the documentation for Object#instace_eval:
http://ruby-doc.org/core/classes/Object.html#M000343

That should get you started.

-Justin
Sachin Gadkar (Guest)
on 2007-01-10 10:07
(Received via mailing list)
Thank you very much... I got my answer
Let me tell you I am in love with Ruby.

On 1/10/07, Justin Collins <collinsj@seattleu.edu> wrote:
> > programming.
> That should get you started.
>
> -Justin
>
>


--
sachin.gadkar@gmail.com

URL : http://nichas143.tripod.com
This topic is locked and can not be replied to.