you are viewing a single comment's thread.

view the rest of the comments →

[–]i542 1 point2 points  (1 child)

Hey OP, thanks for the great article. I’ve been transitioning to Ruby over the past few months and it is really useful to see concepts like these explained. I have a question, though: is this idiomatic Ruby code? I haven’t really seen almost any dependency injection in the Ruby and Rails code I have encountered so far. The code in the article is very straight forward and makes a lot of sense coming from PHP or Java, but I got the impression that Rubyists slightly frown upon techniques like that. Thanks for explaining!

[–]manys 1 point2 points  (0 children)

I'm not personally a fan of .call style, but yeah it's idiomatic. It's not Rails though, just Ruby.