Read my latest article: Ruby 1.8.7 on MacPorts causing some problems (posted Fri, 20 Jun 2008 21:11:00 GMT)

Master, console, and servant part two

Posted by Robby Russell Tue, 04 Oct 2005 04:54:00 GMT

This is a brief addition to the post from a few days ago, Master, console, and servant.

Noradio on IRC pointed out one thing that I did not mention in my previous blog entry… that you can bind a subsession of irb to a specific object. What??

Okay, let me explain this a bit more. Instead of always setting a variable to hold an instance of an object, you can be a bit more creative with irb.

I present…

So, for example. You can perform the following in script/console.

irb Model.find(4) name

If there is an attribute/method called name in your model, then it will call it there. See my screen shot for some more details of how I used the jobs and fg # commands to switch jobs…. and I even found out what happens when you attempt to switch to the current thread. :-)

Until next time…

Subscribe to my RSS feed Enjoying the content? Be sure to subscribe to my RSS feed.
Comments

Share your thoughts... (really...I want to hear them)

Comments