From ee26f26ab5e39eec402ea01109b9ba736d06b5b6 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 11 Feb 2021 18:30:58 +0100 Subject: Fix custom marshalization with symbolize_names: true --- lib/psych/visitors/to_ruby.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb index a100188..4d98850 100644 --- a/lib/psych/visitors/to_ruby.rb +++ b/lib/psych/visitors/to_ruby.rb @@ -339,7 +339,7 @@ module Psych list end - def revive_hash hash, o + def revive_hash hash, o, tagged= false o.children.each_slice(2) { |k,v| key = accept(k) val = accept(v) @@ -366,7 +366,7 @@ module Psych hash[key] = val end else - if @symbolize_names + if !tagged && @symbolize_names key = key.to_sym elsif !@freeze key = deduplicate(key) @@ -404,7 +404,7 @@ module Psych def revive klass, node s = register(node, klass.allocate) - init_with(s, revive_hash({}, node), node) + init_with(s, revive_hash({}, node, true), node) end def init_with o, h, node -- cgit v1.2.3