# File lib/tins/string_underscore.rb, line 3 def underscore word = dup word.gsub!(%r::/, '/') word.gsub!(%r([A-Z]+)([A-Z][a-z])/,'\1_\2') word.gsub!(%r([a-z\d])([A-Z])/,'\1_\2') word.tr!("-", "_") word.downcase! word end