Using Lambdas in Ruby
Did you know you can use lambdas as a kind of dynamic hash replacement? The truth is, lambdas are pretty cool once you start to investigate them. In this post we'll cover basic usage and then show you some cool lambda tricks.
Did you know you can use lambdas as a kind of dynamic hash replacement? The truth is, lambdas are pretty cool once you start to investigate them. In this post we'll cover basic usage and then show you some cool lambda tricks.
In a previous post we showed you how the environment variable system works, and busted some common myths. But as one helpful reader pointed out, we didn't say much about security. Since it's become common to use env vars for storing secret API keys and other valuable information, It's important to understand the security implications. Let's take a look.
If you want to be able to effectively manage web apps in development and in production, you have to understand environment variables. This post will show you how environment variables really work - and perhaps more importantly, how they DON'T work. We'll also explore some of the most common ways to manage environment variables in your Rails apps.
By now I think everyone agrees that Pry is the best thing to happen to the Rails console since...well, ever. Built-in to pry are a few really cool features that make it much easier to work with exceptions than it was in plain old IRB. Let's take a look.
In this post we look at Ruby's exception class heirarchy, and how you can use it to be as broad or as narrow as you like when rescuing exceptions.
Exceptions are classes, just like everything else in Ruby. This post will show you how to create your own custom exceptions without falling into some common traps that snare beginners.
Never rescue Exception in Ruby! - Maybe you've heard this before. It's good advice, but it's pretty confusing unless you're already in the know. Let's break this statement down and see what it means.