module Neo4j module Core module CypherTranslator # Cypher Helper def escape_value(value) if value.is_a?(String) || value.is_a?(Symbol) "'#{escape_quotes(sanitize_escape_sequences(value.to_s))}'" else value end end # Like escape_value but it does not wrap the value in quotes def create_escape_value(value) if value.is_a?(String) || value.is_a?(Symbol) "#{sanitize_escape_sequences(value.to_s)}" else value end end # Only following escape sequence characters are allowed in Cypher: # # \t Tab # \b Backspace # \n Newline # \r Carriage return # \f Form feed # \' Single quote # \" Double quote # \\ Backslash # # From: # http://docs.neo4j.org/chunked/stable/cypher-expressions.html#_note_on_string_literals SANITIZE_ESCAPED_REGEXP = /(?