Constants Be Missing!

You write some shiny red code and hand it to somebody else. They find it so useful that it starts to spread, and soon 1000s of people are using your code.

BUT, it now needs an update. And for some ghastly reason, you need to rename the constants from your previous code to something more magical. Therein lies a problem: anyone updating to your new code but using the old constants will have the MRI scream at them.

So what do? const_missing, that’s what. Whenever somebody uses a constant that doesn’t exist, this method is called. And because it’s Ruby — you’re free to do whatever you like with it.