module TextFilter
Public Instance Methods
capitalize_first(input)
click to toggle source
# File lib/kody/modules.rb, line 5 def capitalize_first(input) input[0].upcase + input[1..-1] end
underscore()
click to toggle source
# File lib/kody/modules.rb, line 9 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