Method: Sunspot::Util.camel_case
- Defined in:
- lib/sunspot/util.rb
.camel_case(string) ⇒ Object
Convert a string to camel case
Parameters
- string<String>
-
String to convert to camel case
Returns
- String
-
String in camel case
52 53 54 |
# File 'lib/sunspot/util.rb', line 52 def camel_case(string) string.split('_').map! { |word| word.capitalize }.join end |