Include and Extend Here’s a neat trick I learned today. Typically, when a class includes a module, the module methods become instance methods on the including class.
Modifying Objects in Place Every time you create or copy something in memory, you add work for GC. Here are some tips from the book Ruby Performance Optimization to
Class Metaprogramming in Ruby A Ruby class definition is just regular code that runs. When you use the class keyword to create a class, you aren’t just dictating
How to Implement Callbacks in Ruby There are at least three places in Ruby where you can package code to be executed later. In a block, a proc/lambda, and a
A List of Middleware Used by Rails Here’s a list of middleware Rails uses in a development environment. You can view the middleware by running the bin/rails middleware command from
Caching in Rails These are the notes I took while reading the Rails caching guide. Caching is one of the most effective ways to boost an application’s
A Brief Introduction to Rake Rake is a task runner written in Ruby. It performs repetitive tasks, such as 1. Making database backup 2. Running tests 3. Watch for file