Skip to content

Instantly share code, notes, and snippets.

def camelize_props(hash)
props = hash.reduce({}) do |acc, (key, value)|
if value.respond_to?(:serializable_hash)
acc.merge(key => value.serializable_hash)
else
acc.merge(key => value)
end
end
props.deep_transform_keys! { |key| key.to_s.camelize(:lower) }