camelize(uppercase_first_letter = true)
File activesupport/lib/active_support/inflector/methods.rb, line 68
# File tools/profile, line 118 def camelize(uppercase_first_letter = true) string = self if uppercase_first_letter string = string.sub(/^[a-z\d]*/) { |match| match.capitalize } else string = string.sub(/^(?:(?=\b|[A-Z_])|\w)/) { |match| match.downcase } end string.gsub(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" }.gsub("/", "::") end
String#underscore is inverse for the camelize.
==== "active_record".camelize.underscore # => "active_record"