Clean up repetition in DiscourseApi::Resource

I noticed a lot of repetition was bringing down the Code Climate GPA, so thought I'd clean it up. All tests still pass, nothing new was added in this change set.

I wanted to do something small for my first contribution. Since the [contribution guidelines][guidelines] say you're going for a 4.0 on Code Climate, I thought this would be a good first step.

[guidelines]: http://meta.discourse.org/t/so-you-want-to-help-out-with-discourse/3823