Project

General

Profile

Feature #12960 » 0001-feat-psych-allow-to-generate-custom-Hash-object.patch

kwatch (makoto kuwata), 11/19/2016 03:21 AM

View differences:

ext/psych/lib/psych/visitors/to_ruby.rb
if Psych.load_tags[o.tag]
return revive(resolve_class(Psych.load_tags[o.tag]), o)
end
return revive_hash(register(o, {}), o) unless o.tag
return revive_hash(register(o, empty_mapping(o)), o) unless o.tag
case o.tag
when /^!ruby\/struct:?(.*)?$/
......
end
private
def empty_mapping o
return {}
end
def register node, object
@st[node.anchor] = object if node.anchor
object
(2-2/10)