Skip to content

Instantly share code, notes, and snippets.

@ttanimichi
Last active January 9, 2018 09:28
Show Gist options
  • Save ttanimichi/0958d4d21fee9cf634fcefd64953d00a to your computer and use it in GitHub Desktop.
Save ttanimichi/0958d4d21fee9cf634fcefd64953d00a to your computer and use it in GitHub Desktop.
Hash.class_eval do
if respond_to? :deep_camelize_keys
fail "deep_camelize_keys is already defined"
else
def deep_camelize_keys(first_letter = :upper)
deep_transform_keys { |key| key.to_s.camelize(first_letter) }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment