3 ms·
It's mostly how complete the API is and how consistent. For example: * Hash#merge takes a block for conflict resolution. I use this all the time for aggregating
by ajmurmann 8y ago
It's mostly how complete the API is and how consistent. For example:
* Hash#merge takes a block for conflict resolution. I use this all the time for aggregating counts.
* #sample
* #unique
* Everything has a change in place option by appending "!"
- mmahemoff 8y agoAlso, chaining is extremely concise. e.g. "products.map(&:cost).sort.last"
- klohto 8y agoI couldn't resist... Your example could be improved by using "products.sort_by(&:cost).last" I try to not use map because often there are methods that already implement filtering. Gotta love Ruby readability.