Fix code climate violations
Fix code climate violations

In the Fake Discount Network API we were repeating something and
that was code climate was complaining about. This commit remove
those duplications and refactor those code a bit.

discountnetwork/discountnetwork-ruby,discountnetwork/discountnetwork-ruby