Making #Inject Add Up

Part of my series of easy primers on methods to eliminate code smell: needlessly lengthy or complex code.

inject

Code smell: You’re performing a mathematical function on a series of numbers (like adding or multiplying) and returning


How to #Tap That

Part of my series of easy primers on methods to eliminate code smell: needlessly lengthy or complex code.

tap

Code smell: You’re executing some action on a variable, and then have to return the variable in a separate step.


(Pr)#each_with_object

Part of my series of easy primers on methods to eliminate code smell: needlessly lengthy or complex code.

each_with_object

Code smell: You’re creating an empty hash or array. Then you’re iterating over another hash or array to