class String

Public Instance Methods

capitalize_first(input) click to toggle source
# File lib/kody/string.rb, line 3
def capitalize_first(input)
  input[0].upcase + input[1..-1]
end
underscore() click to toggle source
# File lib/kody/string.rb, line 7
def underscore
  self.
  gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
  gsub(/([a-z\d])([A-Z])/,'\1_\2').
  gsub(/([A-Z\d])([A-Z])/,'\1_\2').
  gsub(/([A-Z\d])([A-Z])/,'\1_\2').
  tr("-", "_").
  downcase
end