paulo-silva / conta_azul_api

Ruby library for ContaAzul API. https://developers.contaazul.com
MIT License
0 stars 6 forks source link

Add a layer for HTTP Responses #14

Closed Cendrao closed 5 years ago

Cendrao commented 5 years ago

This PR is a sugestion to make it easier to handle HTTP responses from API, nowadays you have just a few statuses (200, 401 and 404) mapped, but when I was developing #11 I came across a few other like 400, 422, 201.

The idea is pretty simple, it's just to encapsulate the response in a new class that gives us some helper methods like success?, stauts_code and body. In the feature, you may handle content-types translation there too.

Cendrao commented 5 years ago

Yes sure 😄 I'm working on it

Cendrao commented 5 years ago

@paulo-silva added test in 166bac4