Method: String#to_snake_case!

Defined in:
lib/core_ext/snake_case.rb

#to_snake_case!Object

ruby mutation methods have the expectation to return self if a mutation occurred, nil otherwise. (see www.ruby-doc.org/core-1.9.3/String.html#method-i-gsub-21)



5
6
7
8
# File 'lib/core_ext/snake_case.rb', line 5

def to_snake_case!
  gsub!(/(.)([A-Z])/,'\1_\2')
  downcase!
end