irb tip: get last returned value

Just use underscore.

1
2
3
4
>> "Chunky bacon"
=> "Chunky bacon"
>> _
=> "Chunky bacon"

The fruits of an investigation I started when Jon Baudanza at Rupture offered a brownie bite for the first person to figure it out. I’ll do pretty much anything for a brownie bite…

Update: you can also use conf.last_value, as well as its aliases context.last_value and irb_context.last_value.

Comments

  1. JonJune 02, 2008 @ 12:54 PM

    Brownie bite well deserved!

  2. JonahNovember 13, 2009 @ 09:56 AM

    This is awesome indeed.

  3. JamesJanuary 10, 2013 @ 02:08 AM

    Congratulations on earning your favorite brownie bite. Rupture is one of the best social-network-gaming startups available. Thanks for the tip.


    Inroads

  4. Creative BioscienceMarch 09, 2013 @ 10:44 PM

    Many common terms for seeds and fruit do not correspond to the botanical classifications. In botany, seeds are ripened ovules; fruits are the ripened ovaries or carpels that contain the seeds and a nut is a type of fruit and not a seed. Thanks.

  5. nothingbutbrandnames.com/March 24, 2013 @ 05:06 AM

    Numerous normal terms for seeds and products of the soil don’t compare to the plant groupings. In natural science, seeds are matured ovules; apples and oranges are the aged ovaries or carpels that hold the seeds and a nut is a sort of leafy foods a seed. Much obliged!

  6. Cheap Ray BanApril 01, 2013 @ 11:58 PM

    The material is an important part of glasses. Lens material this exposition or glass lens.

  7. unlockedpokerApril 11, 2013 @ 01:23 AM

    Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article.

  8. sharinaApril 16, 2013 @ 04:48 AM

    Its “essence” is an uncompromising drive to optimize for productivity and happiness. It’s a hard-learned pragmatism: processes for people who refuse to solve the same problem twice, who are annoyed enough by the speed bumps their click here tools sometimes introduce that they happily gas up the steamroller.

  9. computer science dissertationMay 21, 2013 @ 03:44 PM

    What a way to show the things in a manner.

Post a comment

Comment
(not published)
(optional)