Sha256: 36d3aeea71e5abdc14a98c6c92daf3ed72ae741de2b0ef210bf825e69e698ed6
Contents?: true
Size: 348 Bytes
Versions: 14
Compression:
Stored size: 348 Bytes
Contents
require 'yaml' class Hash def to_yaml(opts = {}) YAML::quick_emit(object_id, opts) do |out| out.map(taguri, to_yaml_style) do |map| sorted = self.sort { |a, b| a[0] <=> b[0] } sorted.each { |k, v| map.add(k, v) } end end end end class Symbol def <=>(other) self.to_s <=> other.to_s end end
Version data entries
14 entries across 14 versions & 1 rubygems