Posted 2 months ago. Visible to the public.

IRB: last return value

In the ruby shell (IRB) and rails console the return value of the previous command is saved in _ (underscore). This might come in handy if you forgot to save the value to a variable and further want to use it.

Example:

Copy
irb(main):001:0> 1 + 2 => 3 irb(main):002:0> _ => 3 irb(main):003:0> a = _ => 3

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for old versions of Ruby on Rails (3.2 and 2.3).

Author of this card:

Avatar
Daniel Straßner
Last edit:
2 months ago
by Emanuel De
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Daniel Straßner to makandropedia