---
title: "Using Lambdas to Simplify Varying Behaviors in Your Code"
publication: "Ruby Weekly"
issue: 413
published_at: "2018-08-23"
canonical_url: "https://rubyweekly.com/issues/413"
---

This week's Ruby news, issue 413       

#413 — August 23, 2018 

[Read on the Web](https://rubyweekly.com/issues/413)   

Ruby Weekly  

[Using Lambdas to Simplify Varying Behaviors in Your Code](https://bbs-software.com/blog/2018/08/04/using-lambdas-to-simplify-varying-behaviors-in-your-code.html) — An excellent article on how lambdas are used to remove conditionals and apply design patterns including specific, real-world use cases. 

Keith R. Bennett   

[The Curious Incident of the Shadow in the Run-Time](https://paulfioravanti.com/blog/2018/08/20/the-curious-incident-of-the-shadow-in-the-run-time/) — No, this isn’t the latest teen vampire novel, but a look at how shadowing in various guises can cause confusion in Ruby code. 

Paul Fioravanti   

[Ruby, Meet Rollbar](https://rollbar.com/rubyweekly) — Detect errors in your production Ruby apps with our lightweight SDK, then debug them within minutes before your users notice. Get unlimited errors during your free trial. 

ROLLBAR sponsor   

[Scaling Rails at Instacart: Distributing Data Across Multiple Postgres Databases](https://tech.instacart.com/scaling-at-instacart-distributing-data-across-multiple-postgres-databases-with-rails-13b1e4eba202) — Some of best articles come from companies explaining how they solve real issues, just like Instacart does here. 

Doug Hyde   

▶[Discussing Ruby Performance with Nate Berkopec](https://devchat.tv/ruby-rogues/rr-376-ruby-performance-with-nate-berkopec/) — Nate is both a prolific blogger on the topic of performance in Ruby and he’s a Ruby performance consultant too, meaning you’re sure to learn a few things from this hour-long chat. 

Ruby Rogues   

[RubyFlow: A Ruby Community Link Blog](http://www.rubyflow.com/) — _RubyFlow_ is a community blog we run (all you need is a GitHub account to post) and has become one of our main sources of links, so if you have a library, tutorial, or something else Ruby related, post about it there. 

RubyFlow  

💻 Jobs  

[Ruby on Rails Developer at Kollegorna (Remote)](https://www.kollegorna.se/job-backend) — We build first-rate digital products, have nice perks, the finest colleagues, and won’t work you to death. 

Kollegorna   

[Technical Architect – London](https://www.dxw.com/jobs/technical-architect/) — dxw helps public sector teams build better digital services. You’ll help our teams build great services and coach & grow the team. 

dxw digital   

[Find A Ruby Job Through Vettery](https://www.vettery.com/tech?utm_source=newsletter&utm_medium=cooper-rubyweekly&utm_term=tech&utm_content=grouped&utm_campaign=ad-77582) — Vettery specializes in dev roles and is completely free for job seekers. Create a profile to get started. 

Vettery  

📘 Tutorials  

[Indexes on Rails: How to Make The Most of Your Postgres Database](https://karolgalanciak.com/blog/2018/08/19/indexes-on-rails-how-to-make-the-most-of-your-postgres-database/) — _“Optimizing database queries is arguably one of the fastest ways to improve the performance of the Rails applications.”_ Read this post to see how. 

Karol Galanciak   

[Statements and Expressions in Ruby](https://supergood.software/statements-and-expressions/) — Find out the difference between statements and expressions in Ruby, with a concrete, but highly unusual example. 

Jared Norman   

[From Service Objects To Interactors](http://www.jaredrader.com/technical/2018/08/21/from-service-objects-to-interactors/) — Once you’ve evolved to using service objects, it’s a good idea to formalize the “how” so you don’t end up with service object soup. 

Jared Rader   

[Upgrade Rails From 5.0 to 5.1](https://www.ombulabs.com/blog/rails/upgrades/upgrade-rails-from-5-0-to-5-1.html) — Six simple steps. 

Ombu Labs   

[Cut Your Heroku Bill in Half — Autoscaling That Just Works](https://railsautoscale.com/ruby-weekly) 

Rails Autoscale sponsor   

[Clean Module Injection in Ruby](https://medium.com/@hcstebbins/clean-module-injection-in-ruby-91c2ca34e0ec) — Monkeypatching is often labeled as ‘evil’, but sometimes it’s the best of many bad options. Here’s how to be ‘evil’ in a cleaner way. 

Harry Stebbins   

[Solving the N-Queens Problem With Ruby](https://www.rubyguides.com/2018/08/n-queens/) — A coding challenge that involves placing N queens on a N x N chessboard and have every queen out of the reach of the other queens. 

Jesus Castello  

🔧 Code & Tools  

[Torque PostgreSQL: Support for More Complex PostgreSQL Concepts](https://github.com/crashtech/torque-postgresql) — Makes handling complex PostgreSQL types, such as enums and intervals, easier, as well as adding support for CTEs/auxiliary statements. 

Carlos Silva   

[Seeing Red? Catch Performance Issues With SolarWinds AppOptics](https://www.appoptics.com/monitor/ruby-performance?utm_source=rubyweekly&utm_medium=email&utm_campaign=2018_08_23_rubyweekly&CMP=SYN-EDM-RUBYW-LB_NA_US_NP_FLT_CQ_EN_X_X-APO-20180823_X_X_X-X) — Application & infrastructure monitoring, performance metrics, distributed tracing & code-level insights – fast. 

SolarWinds AppOptics sponsor   

[um: Create and Maintain Your Own 'man' Pages](https://github.com/sinclairtarget/um) — In what has to be one of the cooler ideas we’ve seen lately, um lets you, um, make man pages on whatever you do using Markdown. 

Sinclair Target   

[A Huge Collection of Ruby One-Liners](http://benoithamelin.tumblr.com/ruby1line/) — Mostly file oriented stuff, like adding blank lines into files, adding line numbers into text files, counting lines, selective printing of certain lines.. 

Benoit Hamelin   

[Geocoder: A Complete Ruby Geocoding Solution](https://github.com/alexreisner/geocoder) — Version 1.5.0 came out just recently. 

Alex Reisner   

[RuboCop: The Ruby Static Code Analyzer and Formatter](https://github.com/rubocop-hq/rubocop) — Perhaps you know about it already, but since we haven’t linked it in a while and releases are still coming thick and fast.. this is a handy tool to have in your Ruby arsenal. 

RuboCop Headquarters         

Curated by [Cooperpress](https://cooperpress.com/) 

[Change your email address](https://rubyweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://rubyweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
