<div dir="ltr">Good evening LRUG<div><br></div><div>Thanks again to all of you that came and sat through my talk, especially those that offered feedback.</div><div><br></div><div>As promised the slides can be found here on Speakerdeck.</div>



<div><br></div><div><a href="https://speakerdeck.com/bestie/improve-your-ruby-code-with-dependency-injection" target="_blank">https://speakerdeck.com/bestie/improve-your-ruby-code-with-dependency-injection</a><br></div><div>

<br></div><div>
I was challenged on a couple of points about default args and hash fetch with a block, so I thought I'd take the opportunity to clarify.</div><div><br></div><div>* I do use an args hash and Hash#fetch ALL THE TIME</div>



<div>* I almost never use the block for a default value, I always prefer my objects to be given what they need rather than have them pull it in. A default argument or a default block is a hack for when you don't have or want a container / parent object.</div>


<div><br></div><div>I also got another question about whether to start a project like this or refactor to it.</div>
<div><br></div><div>I think that either way is fine as I don't think my approach adds a huge amount of code. It really comes down to you and your team, your tolerance for many small simple objects over fewer larger ones and your ambitions for the project.</div>



<div><br></div><div>I love arguing about these things and I'd love to grab a coffee with anyone else who wants to discuss. I'm with Cambridge Healthcare (<a href="http://howareyou.com" target="_blank">howareyou.com</a>) at Google Campus so get in touch.</div>



<div><br></div><div>Cheers!</div><div><div><br>Stephen Best<br>Ruby / Javascript developer, Ember.js evangelist.<br><br><a href="tel:%2B44%207745%20790523" value="+447745790523" target="_blank">+44 7745 790523</a><br><a href="http://linkd.in/stephenbest" target="_blank">linkd.in/stephenbest</a><br>



<a href="http://github.com/bestie" target="_blank">github.com/bestie</a><br>@thebestie</div>
</div></div>