Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Psych does not encode class if descendent from Hash #14

Closed
jtippett opened this Issue May 3, 2011 · 0 comments

Comments

2 participants

jtippett commented May 3, 2011

Psych does not seem to be encoding the class if the object it is serialising is a subclass of Hash.

To whit:

class PreferenceHash; end
ruby-1.9.2-p180 :006 > YAML.dump PreferenceHash.new
"--- !ruby/object:PreferenceHash {}\n"

ruby-1.9.2-p180 :009 > class PreferenceHash2 < Hash; end
ruby-1.9.2-p180 :011 > YAML.dump PreferenceHash2.new
"--- {}\n"

This behaviour is unexpected to me.

@tenderlove tenderlove closed this in b199105 Jun 9, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment