Tim Raymond

ruby

Angular-style Dependency Injection... in Ruby?

When I first saw Angular's automatic dependency injection, my mind was blown. It was reminiscent of the awe that I had when I first saw the magic methods ActiveRecord defines on your models in a Rails application. As I've been spending plenty of quality time with Angular lately, I thought it would be fun to try to bring Angular's automatic dependency injection over to Ruby. There is certainly no shortage of blog posts explaining how Angular's dependency injector works, but in order to build one in Ruby, it's vital that we understand how it works.