The formatting options hash passed to the to_yaml methods do nothing.
At the moment, there appears to be no documented way to format the output of the various to_yaml methods. They all accept an options hash but the documentation does not specify what options may be passed.
Also, the use of to_yaml_style is undocumented.
class Array def to_yaml_style :inline end end
results in inline formatting of the resulting yaml. This is not documented anywhere but works.
This is further described in  and .
Updated by naruse (Yui NARUSE) about 9 years ago
Is this really a bug?
There is no documentation and doesn't work;
it is considered that there was no such function.
So my understanding is, this should be feature request.
Yeah, such function seems useful, but I don't have how it should works.