coingecko_ruby icon indicating copy to clipboard operation
coingecko_ruby copied to clipboard

WIP: Upcoming improvements

Open julianfssen opened this issue 3 years ago • 2 comments

Hello!

Thanks for using this gem. This is my first gem so it's not the best in terms of quality and efficiency. With that in mind, I'm looking to improve the gem in the coming months:

ETA for v0.5: End of December 2021

  • Custom error handling: Create a custom error class to handle errors from CoinGecko's API. Currently, the errors are handled by Ruby which works, but may not identify the actual cause of the error.
  • Custom response object: Currently, the wrapper returns a JSON-parsed response. This works, but some may prefer having a custom response object (à la Octokit's response object) that comes with useful attributes and is smart enough to work with various Enumerable operations. This could be released in another version as some users may rely on the JSON-parsed response.
  • Pagination: Currently, results are returned as is from CoinGecko's API, with pagination only available if you include it as an option during method calls. This can be improved by introducing pagination to every (necessary) endpoint without the need for a page option. Instead, you can call response.next instead to get the next page or response.prev to go back. This is, however, just an idea and it may change as it is implemented.
  • HTTP client customization: Currently, the gem is relying on the internal HTTP module to fetch results with a simple HTTP.get call. This may not work well for repeated calls in a short span of time or if concurrency is needed. I'm looking to make the connection module customizable so it can be tweaked for your use cases.

These are the current tasks that are in my roadmap for this gem. Feel free to create issues or even submit PRs if you're interested. Thanks again for using this gem! :)

julianfssen avatar Aug 09 '21 02:08 julianfssen

Update: I'll also be adding support for authentication for CoinGecko's new premium plans. This will be coming very soon! :)

julianfssen avatar Sep 02 '21 12:09 julianfssen

v0.5 Roadmap

Better error handling

  • [x] Custom error classes for the connection client (delegated via Faraday)
  • [x] Custom error classes for the API's error responses

Improved response object

  • [ ] Custom response object for easy data access
  • [ ] Convenience methods for price-related data
  • [ ] Convenience methods for volume-related data
  • [ ] Convenience methods to search within response objects

Pagination

  • [ ] Add pagination in method calls
  • [ ] Add pagination in response objects

Target date for v0.5 improvements: End of December 2021

julianfssen avatar Oct 30 '21 13:10 julianfssen