Module: Sunspot::Util

Defined in:
lib/sunspot/sunspot_spellcheck.rb

Class Method Summary collapse

Class Method Details

.method_case(string_or_symbol) ⇒ Object



87
88
89
90
91
92
93
94
95
# File 'lib/sunspot/sunspot_spellcheck.rb', line 87

def method_case(string_or_symbol)
  string = string_or_symbol.to_s
  first = true
  string.split('_').map! do |word|
    word = first ? word : word.capitalize
    first = false
    word
  end.join
end