Method: Representable::YAML#to_yaml

Defined in:
lib/representable/yaml.rb

#to_yaml(*args) ⇒ Object



49
50
51
52
53
54
55
# File 'lib/representable/yaml.rb', line 49

def to_yaml(*args)
  stream = Psych::Nodes::Stream.new
  stream.children << doc = Psych::Nodes::Document.new

  doc.children << to_ast(*args)
  stream.to_yaml
end