Ruby Console Underscore Shortcut _

Here’s a nifty ruby console trick I just learned.  The underscore character _ can be used to get the last returned value.  Here’s an example in the Terminal:

Screen Shot 2013-12-27 at 8.42.16 PM

Credit to Charles Wood

Advertisements

One thought on “Ruby Console Underscore Shortcut _

  1. Pingback: Ruby Console Underscore Shortcut | How I Learned Ruby on Rails

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s