Method: Psych::Nodes::Node#yaml

Defined in:
lib/psych/nodes/node.rb

#yaml(io = nil, options = {}) ⇒ Object Also known as: to_yaml

Convert this node to YAML.

See also Psych::Visitors::Emitter



46
47
48
49
50
51
52
# File 'lib/psych/nodes/node.rb', line 46

def yaml io = nil, options = {}
  real_io = io || StringIO.new(''.encode('utf-8'))

  Visitors::Emitter.new(real_io, options).accept self
  return real_io.string unless io
  io
end