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
58 59 60 61 62 63 64 |
# File 'lib/psych/nodes/node.rb', line 58 def yaml io = nil, = {} real_io = io || StringIO.new(''.encode('utf-8')) Visitors::Emitter.new(real_io, ).accept self return real_io.string unless io io end |