Sha256: 97bda32041d48cda9d21b5486fd4878b724d5b97e8f1102e90a00caf86a06fbe
Contents?: true
Size: 232 Bytes
Versions: 8
Compression:
Stored size: 232 Bytes
Contents
class String def underscore word = self.to_s.dup 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! word end end
Version data entries
8 entries across 8 versions & 1 rubygems