Method: Wpxf::Payload#escape_single_quotes

Defined in:
lib/wpxf/core/payload.rb

#escape_single_quotes(val) ⇒ String

Helper method to escape single quotes in a string.

Parameters:

  • val (String)

    the string with quotes to escape.

Returns:

  • (String)

    the string with quotes escaped.



38
39
40
# File 'lib/wpxf/core/payload.rb', line 38

def escape_single_quotes(val)
  val.gsub(/'/) { "\\'" }
end