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

ArgumentError (An hash is required as parameter): #56

Closed
SantaMinus opened this issue Aug 30, 2016 · 4 comments
Closed

ArgumentError (An hash is required as parameter): #56

SantaMinus opened this issue Aug 30, 2016 · 4 comments

Comments

@SantaMinus
Copy link

SantaMinus commented Aug 30, 2016

When I call:
@game_request.spectator_game_info(get_platform(@player.region), @player.summoner_id),
I get an error:
**ArgumentError: An hash is required as parameter
from */ruby-lol-0.12.1/lib/lol/dynamic_model.rb:11:in `initialize'

Debugging shows that hash variable's class is HTTParty::Response in initialize. Should I convert it to a hash somehow?

This problem appeared a day ago, I haven't encountered such error before.
Please help me get rid of it.
Thank you in advance!

@nicolaracco
Copy link
Collaborator

Hi @SantaMinus
I think we're not handling a fringe case, because when the API responds correctly, I receive the right response. (e.g. platform: 'NA1' and summoner_id: '48010225' is working right now).

Could you detail platform and summoner_id so I can have a look at what this edge case is?

@SantaMinus
Copy link
Author

Sure. Here is get_platform method:

def get_platform(region)
platform = region.upcase
platform << '1' unless region.in? ['kr', 'ru']
platform
end

Additionally, here is a screenshot where I get an error even without this method:
selection_024

@nicolaracco
Copy link
Collaborator

I think I found and fixed the issue. Can you try to target the github repo directly (see this for info: http://bundler.io/git.html) to confirm this bug is solved? Then we'll release a new version

@SantaMinus
Copy link
Author

It works now! Thank you very much!

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

2 participants