dblock / strava-ruby-client

A complete Ruby client for the Strava API v3.
https://code.dblock.org/2018/11/27/writing-a-new-strava-api-ruby-client.html
MIT License
97 stars 22 forks source link

include headers in Strava::Errors::Fault response #21

Closed JamesChevalier closed 5 years ago

JamesChevalier commented 5 years ago

Why:

How:

Relevant Links:

dblock commented 5 years ago

Nice and easy.

dblock commented 5 years ago

You might still want to do #11 ;)

JamesChevalier commented 5 years ago

🤔 Do you think it's worth mentioning details about how to access the data in the README?

For example... accessing the current usage: quarterly_usage, daily_usage = e.headers["x-ratelimit-usage"].split(',').map(&:to_i) and accessing the current limits: quarterly_limits, daily_limits = e.headers["x-ratelimit-limit"].split(',').map(&:to_i)

👍 Yeah, I still want to get these details into each response. I don't have a lot of confidence in how I'll approach that, so that pull request probably won't be a quick merge like this. 😄

dblock commented 5 years ago

Definitely useful for a README, can't hurt.

You could wrap headers into a class and expose an additional method called x_rate_limit and expose limit and usage as first class objects, too.