From ecc5a1df73814bf6bc5f7450d3f5cd7ead0c1386 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 7 Dec 2007 19:09:17 +0000 Subject: userdata: classes with singleton methods are not dumpable. dup the hash before storage --- lib/rbot/core/userdata.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/rbot/core/userdata.rb b/lib/rbot/core/userdata.rb index 72cada78..f7c74a4a 100644 --- a/lib/rbot/core/userdata.rb +++ b/lib/rbot/core/userdata.rb @@ -90,10 +90,14 @@ class UserDataModule < CoreBotModule return h[key] end - def set_data_hash(user, h) + def set_data_hash(user, hh) iu = user.to_irc_user bu = iu.botuser + # we .dup the hash to remove singleton methods + # and make it dump-able + h = hh.dup + @ircuser[iu.nick] = h return h if bu.default? -- cgit v1.2.3