Favorites

Geek Mama 2015-12-22

Summary:

Sometimes, I wanna set more than one var at once. This is one of my very favorite ruby tricks that I use every day: irb(main):007:0> a = [1, 2, 3] => [1, 2, 3] irb(main):008:0> x, y, z = a.collect{|i| i * 2 } => [2, 4, 6] irb(main):009:0> x => 2 irb(main):010:0> y => […]

Link:

http://blogs.harvard.edu/lianaleahy/2013/05/23/favorites/

From feeds:

Blogs.law Aggregation Hub » Geek Mama

Tags:

professional

Authors:

Liana Leahy

Date tagged:

12/22/2015, 16:31

Date published:

05/23/2013, 14:49