method
revive_hash
v2_1_10 -
Show latest stable
- Class:
Psych::Visitors::ToRuby
revive_hash(hash, o)private
No documentation available.
# File ext/psych/lib/psych/visitors/to_ruby.rb, line 299
def revive_hash hash, o
o.children.each_slice(2) { |k,v|
key = accept(k)
val = accept(v)
if key == '<<'
case v
when Nodes::Alias
begin
hash.merge! val
rescue TypeError
hash[key] = val
end
when Nodes::Sequence
begin
h = {}
val.reverse_each do |value|
h.merge! value
end
hash.merge! h
rescue TypeError
hash[key] = val
end
else
hash[key] = val
end
else
hash[key] = val
end
}
hash
end