module Neography::Rest::Cypher

Public Instance Methods

execute_query(query, parameters = {}, cypher_options = nil) click to toggle source
# File lib/neography/rest/cypher.rb, line 6
def execute_query(query, parameters = {}, cypher_options = nil)
  options = {
    :body => {
      :query => query,
      :params => parameters
    }.to_json,
    :headers => json_content_type.merge({'Accept' => 'application/json;stream=true;charset=UTF-8'})
  }
  
  @connection.post(optioned_path(cypher_options), options)
end

Private Instance Methods

optioned_path(cypher_options = nil) click to toggle source
# File lib/neography/rest/cypher.rb, line 19
def optioned_path(cypher_options = nil)
  return @connection.cypher_path unless cypher_options
  options = []
  options << "includeStats=true" if cypher_options[:stats]
  options << "profile=true" if cypher_options[:profile]
  @connection.cypher_path + "?" + options.join("&")
end