Sha256: 406663f4f71a7e7f6226552d78cb865452ac31ae5a641253fce785e974720eb3
Contents?: true
Size: 364 Bytes
Versions: 95
Compression:
Stored size: 364 Bytes
Contents
# ********** Copyright 2016 Viacom, Inc. Apache 2.0 ********** class ::String def underscore! word = self word.gsub!(/::/, '/') word.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2') word.gsub!(/([a-z\d])([A-Z])/,'\1_\2') word.tr!("-", "_") word.downcase! nil end def underscore word = self.dup word.underscore! word end end
Version data entries
95 entries across 95 versions & 1 rubygems