Sha256: e5afecbcf73c036459c637e16d1c20ead345ff7602a4125b800e4c1c86547ef3
Contents?: true
Size: 655 Bytes
Versions: 10
Compression:
Stored size: 655 Bytes
Contents
module Waves module Ext # :nodoc: # Utility methods mixed into Hash. module Hash # Return a copy of the hash where all keys have been converted to strings. def stringify_keys inject({}) do |options, (key, value)| options[key.to_s] = value options end end # Destructively convert all keys to symbols. def symbolize_keys! keys.each do |key| unless key.is_a?(Symbol) self[key.to_sym] = self[key] delete(key) end end self end end end end class Hash # :nodoc: include Waves::Ext::Hash end
Version data entries
10 entries across 10 versions & 4 rubygems