Class: String

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

Instance Method Summary collapse

Instance Method Details

#methodizeObject



3
4
5
6
7
8
9
10
# File 'lib/ext/string.rb', line 3

def methodize
  gsub(/([A-Z]+)([A-Z])/,'\1_\2').
      gsub(/([a-z])([A-Z])/,'\1_\2').
      gsub('/' ,'__').
      gsub('::','__').
      gsub(' ','_').
      downcase
end