<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Robby on Rails: Master, console, and servant part two</title>
    <link>http://www.robbyonrails.com/articles/2005/10/03/master-console-and-servant-part-two</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>thoughts.sort_by{|t| t[:topic]}.collect </description>
    <item>
      <title>Master, console, and servant part two</title>
      <description>&lt;p&gt;This is a brief addition to the post from a few days ago, &lt;a href="http://www.robbyonrails.com/articles/2005/10/01/master-console-and-servant"&gt;Master, console, and servant.&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Noradio on &lt;span class="caps"&gt;IRC&lt;/span&gt; pointed out one thing that I did not mention in my previous blog entry&amp;#8230; that you can bind a subsession of &lt;code&gt;irb&lt;/code&gt; to a specific object. What??&lt;/p&gt;


	&lt;p&gt;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 &lt;code&gt;irb&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;I present&amp;#8230;&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://www.planetargon.com/files/~robby/console_irb_bind_objects.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;So, for example. You can perform the following in &lt;code&gt;script/console&lt;/code&gt;.&lt;/p&gt;


&lt;typo:code lang="ruby"&gt;
irb Model.find(4)
name
&lt;/type:code&gt;

	&lt;p&gt;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 &lt;code&gt;jobs&lt;/code&gt; and &lt;code&gt;fg #&lt;/code&gt; commands to switch jobs&amp;#8230;. and I even found out what happens when you attempt to switch to the current thread. :-)&lt;/p&gt;


	&lt;p&gt;Until next time&amp;#8230;&lt;/p&gt;
</description>
      <pubDate>Mon, 03 Oct 2005 23:54:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:9935c416cdd3d27d45838e651ead24ab</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2005/10/03/master-console-and-servant-part-two</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>rails</category>
      <category>ruby</category>
      <category>console</category>
    </item>
  </channel>
</rss>
