def to_yaml(opts = {})
      yaml_preprocess!
      if defined?(YAML::ENGINE) && YAML::ENGINE.yamler == 'psych'
        opts ||= {}
        opts[:line_width] ||= 999999  # Psych doesn't let you disable line wrap
        yaml = super
      else
        yaml = YAML::quick_emit(self, opts) do |out|
          if @render_sorted
            out.seq(nil, @yaml_style || to_yaml_style) do |seq|
              sort.each { |e| seq.add(e) }
            end
          else
            out.seq(nil, @yaml_style || to_yaml_style) do |seq|
              each { |e| seq.add(e) }
            end
          end
        end
      end
      yaml_postprocess yaml
    end
def to_yaml(opts = {})
      yaml_preprocess!
      if defined?(YAML::ENGINE) && YAML::ENGINE.yamler == 'psych'
        opts ||= {}
        opts[:line_width] ||= 999999  # Psych doesn't let you disable line wrap
        yaml = super
      else
        yaml = YAML::quick_emit(self, opts) do |out|
          if @render_sorted
            out.seq(nil, @yaml_style || to_yaml_style) do |seq|
              sort.each { |e| seq.add(e) }
            end
          else
            out.seq(nil, @yaml_style || to_yaml_style) do |seq|
              each { |e| seq.add(e) }
            end
          end
        end
      end
      yaml_postprocess yaml
    end
Render this object as YAML. Before rendering, run the object
 through any yaml_preprocessor() code block. After rendering,
 filter the YAML text through any yaml_postprocessor() code block.

 Nodes marked with render_inline!() or render_values_inline!()
 will be output in flow/inline style, all hashes and arrays will
 be sorted, and we set a long line width to more or less support
 line wrap under the Psych library.