Sha256: 31a39fbda44e31b5a3b0311d73110142aa3b78858d611473deb56c797b3bd4b2
Contents?: true
Size: 369 Bytes
Versions: 7
Compression:
Stored size: 369 Bytes
Contents
require 'active_support/core_ext/hash/keys' class Hash # Camelize all keys of the hash # # @return [Hash] The hash with camelized keys def camelize_keys! deep_transform_keys! do |key| key.to_s .split(/(_*\d+_*)/) .reject(&:empty?) .map { |k| k.camelize(:lower) } .join('_') .to_sym end self end end
Version data entries
7 entries across 7 versions & 2 rubygems