class String

This changes the String class in Ruby's standard library to make life easier by aliasing String#uc to String#upcase and String#dc to String#downcase

Public Instance Methods

camelize() click to toggle source

Somewhat imperfect camelization (from snake-case strings).

# File lib/syndi/rubyext/string.rb, line 10
def camelize
  if self !~ /_/
    capitalize
  else
    words = split /_/
    words.map! { |word| word.capitalize }
    words.join
  end
end