Method: CaseTransform.camel
- Defined in:
- lib/case_transform.rb
.camel(value) ⇒ Object
Transforms values to UpperCamelCase or PascalCase.
@example:
"some_key" => "SomeKey",
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/case_transform.rb', line 28 def camel(value) case value when Array value.map { |item| camel(item) } when Hash hash_ext.deep_transform_keys!(value) { |key| camel(key) } when Symbol camel(value.to_s).to_sym when String camel_cache[value] ||= string_ext.camelize(string_ext.underscore(value)) else value end end |