-
Notifications
You must be signed in to change notification settings - Fork 190
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
how to store result sets for future use? #119
Comments
Ah interesting, so you're thinking it would be handy to keep the This sounds like a handy API method to me - maybe having a method like |
Well, I think if you expose
Truthfully, that feels a little bit hacky since I'm actually trying to cache the requests to Google in order to minimize api usage... and that feels like something that would be an extension of the gem instead of punting it to the application. Or maybe just an extension of HTTParty. Seems like there's a bunch of unmaintained httparty cache gems All that say, I think exposing |
I tried to marshal a result set so that I could store it in a DB with
Marshal.dump(GOOGLE_PLACES.spots_by_query(my_query))
- but that resulted in:ArgumentError (string contains null byte)
So, after poking around
GooglePlaces::Spot.initialize
I see thatjson_result_object
isn't stored on the Spot anywhere, which I suppose, if it were available, could be used to reconstitute the object later on, along with the api key. e.g.GooglePlaces::Spot.new(result_json_object_from_database, my_api_key)
I could submit a PR to make the raw results a bit more accessible, but curious to get the maintainers thoughts first.
Thanks!
The text was updated successfully, but these errors were encountered: