Module: StringFormManipulation

Included in:
String, Symbol
Defined in:
lib/dmorrill10-utils/string_form_manipulation.rb

Instance Method Summary collapse

Instance Method Details

#to_camel_caseObject Also known as: to_class_name

Returns This string in camel-case class name form.

Returns:

  • This string in camel-case class name form.



3
4
5
6
# File 'lib/dmorrill10-utils/string_form_manipulation.rb', line 3

def to_camel_case
  class_name = to_s.capitalize
  class_name.gsub(/[_\s]+./) { |match| match = match[1,].capitalize }
end