Sha256: 240ad560f8cf856a1fc4d7faa85daedaa9f815346eea7ce482447ed926b26e4d
Contents?: true
Size: 340 Bytes
Versions: 12
Compression:
Stored size: 340 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
12 entries across 12 versions & 1 rubygems