Method: String#hyphenize
- Defined in:
- lib/theoldreader/core_ext/string.rb
#hyphenize ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/theoldreader/core_ext/string.rb', line 2 def hyphenize gsub(/::/, '/'). gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). gsub(/([a-z\d])([A-Z])/,'\1_\2'). tr("_", "-"). tr(" ", "-"). downcase end |