Class: Neography::Rest::Gremlin
- Inherits:
-
Object
- Object
- Neography::Rest::Gremlin
- Includes:
- Helpers
- Defined in:
- lib/neography/rest/gremlin.rb
Instance Method Summary collapse
- #execute(script, parameters = {}) ⇒ Object
-
#initialize(connection) ⇒ Gremlin
constructor
A new instance of Gremlin.
Methods included from Helpers
#get_id, #json_content_type, #parse_direction
Constructor Details
#initialize(connection) ⇒ Gremlin
Returns a new instance of Gremlin.
6 7 8 |
# File 'lib/neography/rest/gremlin.rb', line 6 def initialize(connection) @connection = connection end |
Instance Method Details
#execute(script, parameters = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/neography/rest/gremlin.rb', line 10 def execute(script, parameters = {}) = { :body => { :script => script, :params => parameters, }.to_json, :headers => json_content_type } result = @connection.post(@connection.gremlin_path, ) result == "null" ? nil : result end |