Module: AutoTagging::StringExt

Included in:
Config
Defined in:
lib/auto_tagging/string_ext.rb

Instance Method Summary collapse

Instance Method Details

#camelize(str) ⇒ Object



3
4
5
6
# File 'lib/auto_tagging/string_ext.rb', line 3

def camelize(str)
  return str if str !~ /_/ && str =~ /[A-Z]+.*/
  str.split("_").map{|e| e.capitalize}.join
end