Closed ggPeti closed 10 years ago
Awesome! Thank you very much for finding the issue and taking the time to fix it.
If I might ask; are you using futuroscope in some project, just playing with it...?
Sure, no problem - I'm a developer at WhitePages and I'm looking into using futuroscope in one of the company's products. But it was just by sheer chance that I haven't found it first for a personal project. I love its interface, especially the convenience methods, it feels very ruby-ish :) :+1:
__getobj__
was retrieving:value
from@resolved_future
, but on the other hand,__setobj__
was not creating a hash with the given value for the:value
key. This led to a failure withdup
becauseinitialize_dup
inDelegator
uses these methods to duplicate a delegator.After a bit of thinking I realized that this was set up intentionally, because
marshal_load
ofDelegator
also uses__setobj__
, so when we load a dumped object, the correct value from the overriddenmarshal_dump
gets written. But this is a conceptual error, because__getobj__
is supposed to do the opposite of__setobj__
, as ismarshal_dump
supposed to do the opposite ofmarshal_load
. So I overrode the latter, and corrected__setobj__
.