Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/bloggit/etc/string.rb

Instance Method Summary collapse

Instance Method Details

#to_slugObject



2
3
4
# File 'lib/bloggit/etc/string.rb', line 2

def to_slug
  self.downcase.gsub( /[^-a-z0-9~\s\.:;+=_]/, '').gsub(/[\s\.:;=_+]+/, '-').gsub(/[\-]{2,}/, '-').to_s
end