Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static API request with rate limits fail with no implicit conversion of String to Integer #67

Closed
hebron-george opened this issue Dec 14, 2017 · 3 comments

Comments

@hebron-george
Copy link
Contributor

client = Lol::Client.new '<my_api_key>', 
  region: 'na',
  rate_limit_requests: 10, 
  rate_limit_seconds: 3600

all_champions = client.static.champions.get 

# => project_path/vendor/ruby/2.4.0/gems/glutton_ratelimit-0.2.0/lib/glutton_ratelimit.rb:26: warning: constant ::Fixnum is deprecated
# => TypeError: no implicit conversion of String into Integer

I stepped through static_request.rb and the problem seems to be coming from https://github.com/mikamai/ruby-lol/blob/master/lib/lol/request.rb#L131-L133

The times method from @rates_limiter is making perform_rate_limited_request return 1 when Lol::Client is initialized with rate limit info.

I tried the exact same request except without the rate limit info:

client = Lol::Client.new '<my_api_key>', 
  region: 'na'

And that worked without any problems.

@hebron-george
Copy link
Contributor Author

Opened PR #71

@baseballlover723
Copy link
Contributor

This also affects the summoner endpoint as well (https://github.com/mikamai/ruby-lol/blob/master/lib/lol/summoner_request.rb#L23), that errors with An hash is required as parameter. This is due to perform_rate_limited_request returning one because of the rate_limiter. PR #71 should fix this as well. I'm guessing that this affects more endpoints as well.

oeN pushed a commit that referenced this issue Jun 11, 2018
bump version after merging #71 and #73
resolve #72 and #67
@oeN
Copy link
Collaborator

oeN commented Jun 11, 2018

solved #73

@oeN oeN closed this as completed Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants