Marshal.dump is unable to dump classes that include a singleton(eigenclass). I\'d like to see how the method determines the presence of this singleton but I do not know how to
The check is here, but it is in C - and MRI code is infamously opaque.
I believe a check similar to that, but in Ruby, would be:
obj.singleton_class.instance_methods(false).empty? &&
obj.singleton_class.instance_variables.empty?
If that is false
(i.e. if anything is defined on the singleton), no dump for you.