Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
An attempt at YAML options
# Setting options for to_yaml doesn't work.
# *
# *
# This is an attempt to workaround by directly setting a flag in the
# emitter. Fail. If I recall right, trying to set/modify the @options
# hash also does not work.
# :UseHeader => false
module YAML
def YAML.emitter
e =
:UseHeader => false,
:use_header => false,
'UseHeader' => false,
'use_header' => false
).set_resolver( YAML.resolver )
puts [1,2,3].to_yaml(e)
puts e.instance_variable_get(:@options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.