Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/permalinker/string_ext.rb
Instance Method Summary collapse
Instance Method Details
#to_permalink ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/permalinker/string_ext.rb', line 2 def to_permalink str = self.de_2_int str.gsub!(/'/, "") str.gsub!(/[^-\w\d]+/sim, "-") str.gsub!(/-+/sm, "-") str.gsub!(/^-?(.*?)-?$/, '\1') str.downcase! str end |