Module: CorrectLink

Defined in:
lib/correct_link.rb

Class Method Summary collapse

Class Method Details

.convert(str) ⇒ Object



2
3
4
# File 'lib/correct_link.rb', line 2

def self.convert str
  str.gsub(/(-|\s|\?|\!|\.|\,|\"|\'|\:|\#|\%|\&|\:|\;|\<|\>|\[|\]|\^|\`|\{|\}|\|)/, "_").gsub(/_+/, "_").gsub(/(^_|_$)/, "").downcase
end