Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Object#to_yaml
(?indentation: ::Integer, ?line_width: ::Integer, ?canonical: bool, ?header: bool) -> ::String
[IO] (IO, ?indentation: ::Integer, ?line_width: ::Integer, ?canonical: bool, ?header: bool) -> IO
to_yaml(options = {})
ext/psych/lib/psych/core_ext.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ext/psych/lib/psych/core_ext.rb, line 12
def to_yaml options = {}
Psych.dump self, options
end
Convert an object to YAML. See Psych.dump for more information on the available options.