Class: Keymaker::PathTraverseRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/keymaker/path_traverse_request.rb

Instance Attribute Summary

Attributes inherited from Request

#config, #opts, #service

Instance Method Summary collapse

Methods inherited from Request

#initialize

Constructor Details

This class inherits a constructor from Keymaker::Request

Instance Method Details

#path_traverse_propertiesObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/keymaker/path_traverse_request.rb', line 15

def path_traverse_properties
  # :order - breadth_first or depth_first
  # :relationships - all, in, or out
  # :uniqueness - node_global, none, relationship_global, node_path, or relationship_path
  # :prune_evaluator
  # :return_filter
  # :max_depth

  {}.tap do |properties|
    properties[:order] = opts.fetch(:order, "breadth_first")
    properties[:relationships] = opts.fetch(:relationships, "all")
    properties[:uniqueness] = opts.fetch(:uniqueness, "relationship_global")
    properties[:prune_evaluator] = opts[:prune_evaluator] if opts[:prune_evaluator]
    properties[:return_filter] = opts[:return_filter] if opts[:return_filter]
    properties[:max_depth] = opts[:max_depth] if opts[:max_depth]
  end
end

#submitObject

POST localhost:7474/db/data/node/9/traverse/path Accept: application/json Content-Type: application/json “order”:“breadth_first”,“uniqueness”:“none”,“return_filter”:{“language”:“builtin”,“name”:“all”}



11
12
13
# File 'lib/keymaker/path_traverse_request.rb', line 11

def submit
  service.post(path_traverse_node_path(opts[:node_id]), path_traverse_properties)
end