Master Ruby/Rails Programming
Notes to self
Wednesday, September 9, 2009
IRB tricks: assign last statement's return value to a var
irb(main):001:0> 1+2
=> 3
irb(main):002:0> a=_
=> 3
irb(main):003:0> a
=> 3
Underscore assigns the last executed statement's return value to a.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Blog Archive
►
2010
(2)
►
April
(1)
►
March
(1)
▼
2009
(6)
▼
September
(2)
Export MySQL query result to a CSV file
IRB tricks: assign last statement's return value t...
►
March
(1)
►
February
(2)
►
January
(1)
►
2008
(51)
►
December
(1)
►
November
(2)
►
October
(2)
►
September
(3)
►
August
(1)
►
July
(2)
►
June
(2)
►
May
(3)
►
April
(3)
►
March
(12)
►
February
(12)
►
January
(8)
No comments:
Post a Comment