Class: Regexp

Inherits:
Object
  • Object
show all
Defined in:
lib/expire_me/adapter.rb

Instance Method Summary collapse

Instance Method Details

#unregexObject



20
21
22
23
24
# File 'lib/expire_me/adapter.rb', line 20

def unregex
  self.to_s.gsub('?i-mx:', ''). # Remove initial ruby stuff
    gsub(/(\=\)|)\(\[0-9\]\+\)/, '='). # Empties the value subgroup, heavily escaped because we're operating on a regex
    gsub(/[^\d\w\-\=]/, '') # Replaces all nondigits and words
end