Documentation for Psych to_yaml options?

前端 未结 2 1271
广开言路
广开言路 2021-01-01 11:10

Ruby 1.9.3 defaults to using Psych for YAML. While the ruby-doc documentation for it is completely lacking, I was able to find one external piece of documentation

2条回答
  •  余生分开走
    2021-01-01 11:25

    Deep in the guts of ruby-1.9.3-p125/ext/psych/emitter.c I found three options:

    • indentation - The level must be less than 10 and greater than 1.
    • line_width - Set the preferred line width.
    • canonical - Set the output style to canonical, or not (true/false).

    And they work!

提交回复
热议问题