class Addressable::Template
def normalize_keys(mapping)
-
(Hash)
-
Parameters:
-
mapping
(Hash
) -- A mapping hash to normalize
def normalize_keys(mapping) return mapping.inject({}) do |accu, pair| name, value = pair if Symbol === name name = name.to_s elsif name.respond_to?(:to_str) name = name.to_str else raise TypeError, "Can't convert #{name.class} into String." end accu[name] = value accu end end