Tag Archives: tap

More cool stuff with ruby’s tap method

I had to write up a quick data processor at work today and I wanted a decent output at the end of execution. The ruby tap method came in handy here. class AssetDeliveryPopulater   def self.populate results_text = [] asset_secrets_count, asset_delivery_count, asset_not_found_count, asset_delivery_creation_errors = 0,0,0,0   Email.all.tap{|emails| [...]
Posted in Software | Also tagged | Comments closed

Tap before you squash

Tap is a pretty awesome ruby method I recently discovered. Let’s say I have the following request: post '/api/v1/users/', params.merge(:sig => Authentication.calculate(TestAuthData.secret_access_key,params.to_query) ).to_json I realize [...]
Posted in Software | Also tagged , | Comments closed