Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Psych::Visitors::ToRuby#init_with
init_with(o, h, node)
ext/psych/lib/psych/visitors/to_ruby.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ext/psych/lib/psych/visitors/to_ruby.rb, line 453
def init_with o, h, node
c = Psych::Coder.new(node.tag)
c.map = h
if o.respond_to?(:init_with)
o.init_with c
else
h.each { |k,v| o.instance_variable_set(:"@#{k}", v) }
end
o
end
No documentation available
See also
#deserialize
#register
#deduplicate
#register_empty
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0