tips

Creating a deeply nested Hash in Ruby

3 minute read

Sometimes you’ll have to create a deeply nested hash without knowing how deep it can be at first. This hash should allow reading and setting values at any le...

Ruby one-liners for file manipulations

10 minute read

Most people using Ruby nowdays are using it for Rails. They often defined themselves has ‘Rails developers’, not ‘Ruby developers’. I’m an early adopter of R...

How to use infinity in your code

less than 1 minute read

You’ll sometimes have to use the notion of infinity in your Ruby code. There isn’t any way to directly use infinity in Ruby, at least none that I know of… Bu...

Encapsulate a code block in an object

3 minute read

Ruby is a very dynamic language which allows you to do things like encapsulate a piece of code in an object. This is a really powerful capability you can use...