Sha256: 29aac5e29e91dd62bdff895ff9550faf5ed92eb68edf18806119ea951287a142
Contents?: true
Size: 342 Bytes
Versions: 34
Compression:
Stored size: 342 Bytes
Contents
#!/usr/bin/env ruby # frozen_string_literal: true # encoding=utf-8 # hash with keys sorted by name # add Hash.sym_keys # class Hash unless defined?(sort_by_key) def sort_by_key keys.sort.to_h { |key| [key, self[key]] } end end unless defined?(sym_keys) def sym_keys transform_keys(&:to_sym) end end end
Version data entries
34 entries across 34 versions & 1 rubygems