Class: Neography::Rest::Cypher

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/neography/rest/cypher.rb

Instance Method Summary collapse

Methods included from Helpers

#get_id, #json_content_type, #parse_direction

Constructor Details

#initialize(connection) ⇒ Cypher

Returns a new instance of Cypher.



6
7
8
# File 'lib/neography/rest/cypher.rb', line 6

def initialize(connection)
  @connection = connection
end

Instance Method Details

#query(query, parameters = {}, cypher_options = nil) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/neography/rest/cypher.rb', line 10

def 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