From: why the lucky stiff Date: 2005-05-15T06:49:20+09:00 Subject: Re: How to output inline list by to_yaml meruby@gmail.com wrote: >require 'yaml' >l = [1, 2, 3] >l.to_yaml >=> "--- \n- 1\n- 2\n- 3\n" > >How can I get inline list so that output of to_yaml will be >=> "--- [1, 2, 3]" > The YAML library which comes with Ruby 1.8.2 won't allow this. But current versions of Syck CVS simply require you to add a `to_yaml_style' method: >> l = [1, 2, 3] => [1, 2, 3] >> def l.to_yaml_style; :inline; end => nil >> puts l.to_yaml --- [1, 2, 3] _why