How to serialize a Sawyer::Resource object?
xystushi opened this issue · 5 comments
xystushi commented
The new release of Octokit uses Sawyer to replace Hashie::Mash. I would like to cache some results as such pull requests. How should I serialize Sawyer::Resource objects and save them to disk?
I tried YAML
and it complaint can't dump anonymous class
. I also tried Marshal
and it complaint singleton can't be dumped
.
anselmbradford commented
Marshal
serialization doesn't appear to be fixed. I tried to serialize a Sawyer::Resource object using Rail's 3.2.13 caching and it returns singleton can't be dumped
E.g. something like:
Rails.cache.fetch('response', :expires_in => 1.minutes) do
response #Sawyer::Response obj
end
pengwynn commented
Yeah, we just fixed up YAML.dump
. Patches welcome for fixing Marshal
serialization.
envygeeks commented
I'm confused here, if this is not fixed properly why is this ticket closed still?!