I recently came across this reddit, demo'ing "dependency injection and inversion of control" in what I think is C#/.Net?
It resulted in a predictable spate of comments on reddit saying basicaly "oh my gosh, dependency injection is so evil, just look at that."
But it got me thinking about how I'd handle the same issues in ruby, and I think the issues to be handled are real issues. So let's look at that.
I don't understand the (.Net?) framework being used in the original example, and I don't feel like reproducing an app environment that would do similar in ruby, so let's just stick to the heart of the matter. They've got some class (not entirely sure which one it is in their tree) that has a method that processes payments, translating that method into ruby it looks something like this: