class String

Created on 2017-03-17

@author: Nikolay Moskvin <moskvin@sibext.com>

Public Instance Methods

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