Feature #2784

The formatting options hash passed to the to_yaml methods do nothing.

Added by Anshul Khandelwal about 5 years ago. Updated almost 4 years ago.

[ruby-core:28318]
Status:Closed
Priority:Normal
Assignee:Aaron Patterson

Description

=begin
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 [1] and [2].

[1] http://stackoverflow.com/questions/1054730/is-it-possible-to-specify-formatting-options-for-toyaml-in-ruby
[2] http://stackoverflow.com/questions/2156762/how-to-get-the-formatting-options-for-the-to-yaml-method-working-on-ruby-1-9-1
=end

History

#1 Updated by Jarl Friis about 5 years ago

=begin
Not only is the options hash not documented, it is not working either.

=end

#2 Updated by Yusuke Endoh almost 5 years ago

  • Assignee set to Aaron Patterson
  • Priority changed from High to Normal

=begin
Hi,

Aaron, what do you think about this ticket?

--
Yusuke Endoh mame@tsg.ne.jp
=end

#3 Updated by Yui NARUSE almost 5 years ago

=begin
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.
=end

#4 Updated by Yusuke Endoh almost 5 years ago

  • Target version set to 2.0.0

=begin

=end

#5 Updated by Anonymous over 4 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r28573.
Anshul, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF