coderhs / ruby_open_weather_map

A ruby wrapper for open weather map
MIT License
79 stars 52 forks source link

merge! leaving options dirty #37

Open sudoaza opened 7 years ago

sudoaza commented 7 years ago

merge! usage in find.rb seem to be leaving the options with the request parameters, affecting subsequent api calls

coderhs commented 6 years ago

@sudoaza sorry about not following up on the issue. Can you give me an example of the request. Would be useful for future reference and i will merge it along with the example in the comment so that we can know why we changed it.

i believe we used ! to save memory else we might be making a lot of object based on the volume of request you application send.

sudoaza commented 6 years ago

consider this code

options = {}
OpenWeather::Find.accurate(query, options)
# now options has {q: query, type: 'accurate'}

next call with the same options variable would return nothing