Sha256: 97177b1ceeb56cea1b60086075a565fd48b5f6ffc939310dad4dde62e440d679

Contents?: true

Size: 626 Bytes

Versions: 1

Compression:

Stored size: 626 Bytes

Contents

# -*- coding: UTF-8 -*-

# Persian module
module Persian
  # Persian Unicode class
  class Url
    def self.urlify(text)
      # remove brackets
      text = Text.remove_brackets(text)
      # remove harekats
      text = Text.remove_harekats(text)
      # remove slash and backslash
      text = text.gsub(%r{(\/||\\)}, '')
      # remove signs
      text = Text.remove_signs(text, ' ')
      # Remove extra spaces
      text = Text.remove_extra_spaces(text)
      # trim spaces from start and end of text
      text = text.strip
      # replace space with dash
      text = text.gsub(/\s/, '-')
      text
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
persian-0.2.2 lib/persian/url.rb