coingecko_ruby
coingecko_ruby copied to clipboard
WIP: Upcoming improvements
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 callresponse.next
instead to get the next page orresponse.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 simpleHTTP.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! :)
Update: I'll also be adding support for authentication for CoinGecko's new premium plans. This will be coming very soon! :)
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