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

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 = {}) ⇒ Object



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

def query(query, parameters = {})
  options = {
    :body => {
      :query => query,
      :params => parameters
    }.to_json,
    :headers => json_content_type.merge({'Accept' => 'application/json;stream=true'})
  }

  @connection.post(@connection.cypher_path, options)
end