Method: String#underscore!

Defined in:
lib/extra/string.rb

#underscore!Object

Destructive version of String#underscore.

Returns: String or nil.



174
175
176
177
# File 'lib/extra/string.rb', line 174

def underscore!
  underscored = underscore
  self[0..-1] = underscored unless underscored == self
end