Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/bandwidth/string_patch.rb

Instance Method Summary collapse

Instance Method Details

#camelizeObject



2
3
4
# File 'lib/bandwidth/string_patch.rb', line 2

def camelize
  self.split(/[^a-z0-9]/i).map{ |w| w[0, 1].upcase + w[1..-1] }.join
end

#uncapitalizeObject



6
7
8
# File 'lib/bandwidth/string_patch.rb', line 6

def uncapitalize
  self.sub(/^(.)/) { |m| m.downcase }
end