Can 开发者_StackOverflow社区I limit the recursion depth of PP.pp or to_yaml in Ruby? If not is there another function I can use?As far as I know there is no easy way to do this. The #inspect method wh
s = \"你好\" s.encoding# => #<Encoding:UTF-8> yaml = s.to_yaml# => \"--- \\\"\\\\xE4\\\\xBD\\\\xA0\\\\xE5\\\\xA5\\\\xBD\\\"\\n\"
According to the YAML documentation it\'s possible to pass a hash of options to the .to_yaml method. Currently when I pass the options as suggested by the documentation it\'s not working, the hash is