Psych.dump(o) â string of yaml
Psych.dump(o, options) â string of yaml
Psych.dump(o, io) â io object passed in
Psych.dump(o, io, options) â io object passed in
Psych.dump(o, options) â string of yaml
Psych.dump(o, io) â io object passed in
Psych.dump(o, io, options) â io object passed in
Class Public methods
Dump Ruby object o
to a YAML string. Optional
options
may be passed in to control the output format. If an
IO object is passed in, the YAML will be dumped to
that IO object.
Example:
# Dump an array, get back a YAML string Psych.dump(['a', 'b']) # => "---\n- a\n- b\n" # Dump an array to an IO object Psych.dump(['a', 'b'], StringIO.new) # => #<StringIO:0x000001009d0890> # Dump an array with indentation set Psych.dump(['a', ['b']], :indentation => 3) # => "---\n- a\n- - b\n" # Dump an array to an IO with indentation set Psych.dump(['a', ['b']], StringIO.new, :indentation => 3)
Please login to continue.