Class Array
In: lib/core_ex/yaml.rb
Parent: Object

Methods

External Aliases

to_yaml -> old_to_yaml

Public Instance methods

[Source]

# File lib/core_ex/yaml.rb, line 159
  def is_complex_yaml?
    any? { |x| x.is_complex_yaml? } or inspect.size > 80
  end

[Source]

# File lib/core_ex/yaml.rb, line 145
  def to_yaml ( opts={} )
    inline = nil
    if YAML.have_option? opts, :Inline and not is_complex_yaml?
      inline = :inline
    end
    YAML::quick_emit(object_id, opts) do |out|
      out.seq( taguri, to_yaml_style || inline ) do |seq|
        each { |x| seq.add x }
      end
    end
  end

[Validate]