Module: Groonga::Client::ScriptSyntax

Defined in:
lib/groonga/client/script-syntax.rb

Class Method Summary collapse

Class Method Details

.format_string(string) ⇒ Object



21
22
23
24
25
26
# File 'lib/groonga/client/script-syntax.rb', line 21

def format_string(string)
  escaped_string = string.gsub(/["\\]/) do |matched|
    "\\#{matched}"
  end
  "\"#{escaped_string}\""
end