small medium large xlarge

07 Mar 2011, 15:26
James D. Maher (5 posts)

I learned the existence of self a while ago, and often find that asking “What’s self” helps me to work my way out of confusion (and I’m VERY easily confused). Now that you’ve revealed the existence of current class, I believe that might be equally useful.

I can simply code self to determine “What’s self?”.

How about current class? Anyway to easily see what that is?

For example, I got excited when you showed definition of an outer_meth and declared that method WAS defined in the then current class. You said “What that class is is kinda weird, but Ruby has a current class at all levels” (sic). Well, don’t leave me guessing! WHAT is the current class when defining an outer method? Is there any way I can see what the then current class is?

BTW, I’m getting a lot out of this. I’ll re-watch in a couple days, think for the rest of the week, and watch Episode 2 next week.

Thanks so much,


01 Feb 2012, 14:11
Dave Thomas (366 posts)

There’s no reflection built in to Ruby to let you get to the current class. It would be cool if there was.

You must be logged in to comment