class String
Public Class Methods
randomize(length = 8)
click to toggle source
# File lib/sunrise/core_ext/string.rb, line 11 def self.randomize(length = 8) Array.new(length) { (rand(122 - 97) + 97).chr }.join end
Public Instance Methods
parameterize(sep = '-')
click to toggle source
# File lib/sunrise/core_ext/string.rb, line 6 def parameterize(sep = '-') value = Sunrise::Utils::Transliteration.transliterate(self) ActiveSupport::Inflector.parameterize(value, sep) end