Module: StringFormManipulation
Instance Method Summary collapse
-
#to_camel_case ⇒ Object
(also: #to_class_name)
This string in camel-case class name form.
Instance Method Details
#to_camel_case ⇒ Object Also known as: to_class_name
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 |