class Hash

Public Instance Methods

calculate_stable_hashable() click to toggle source
# File lib/core-extensions/hash_ext.rb, line 21
def calculate_stable_hashable
  map { |k,v| "#{k.inspect}:#{v.inspect}" }.sort.join("//")
end
stringify_keys() click to toggle source
# File lib/core-extensions/hash_ext.rb, line 4
def stringify_keys
  r = []
  each { |k,v| r << k.to_s << v }
  Hash[*r]
end
symbolize_keys() click to toggle source
# File lib/core-extensions/hash_ext.rb, line 10
def symbolize_keys
  r = []
  each { |k,v| r << (k.respond_to?(:to_sym) ? k.to_sym : k) << v }
  Hash[*r]
end