Module: Neography::Rest::Gremlin

Includes:
Helpers
Included in:
Neography::Rest
Defined in:
lib/neography/rest/gremlin.rb

Instance Method Summary collapse

Methods included from Helpers

#encode, #escape, #get_id, #json_content_type, #parse_depth, #parse_direction, #parse_order, #parse_type, #parse_uniqueness

Instance Method Details

#execute_script(script, parameters = {}) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
# File 'lib/neography/rest/gremlin.rb', line 6

def execute_script(script, parameters = {})
  options = {
    :body => {
      :script => script,
      :params => parameters,
    }.to_json,
    :headers => json_content_type
  }
  result = @connection.post(@connection.gremlin_path, options)
  result == "null" ? nil : result
end