Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter/core_ext/string.rb

Instance Method Summary collapse

Instance Method Details

#camelizeString

Converts a snake_case string to CamelCase

Returns:



6
7
8
# File 'lib/twitter/core_ext/string.rb', line 6

def camelize
  self.gsub(/\/(.?)/){"::#{$1.upcase}"}.gsub(/(?:^|_)(.)/){$1.upcase}
end