Module: RSolr::Char

Included in:
RSolr
Defined in:
lib/rsolr/char.rb

Overview

A module that contains (1) string related methods

Instance Method Summary collapse

Instance Method Details

#escape(value) ⇒ Object

backslash everything that isn’t a word character



6
7
8
# File 'lib/rsolr/char.rb', line 6

def escape value
  value.gsub(/(\W)/, '\\\\\1')
end