Extraction of the key_transform abilities of ActiveModelSerializers
gem 'case_transform'
or
gem install case_transform
And for faster performance, checkout Case Transform with Native Extensions
require 'case_transform'
CaseTransform.camel_lower(value)
value
can be any of Array, Hash, Symbol, or String.
Any other object type will just be returned.
Description | |
---|---|
camel | PascalCase |
camel_lower | camelCase |
dash | dash-case |
underscore | under_score |
unaltered | pass through |