From 6b8bd1c71e6ccba9ce3ab6876726dc27e8a7096d Mon Sep 17 00:00:00 2001 From: Roel van Dijk Date: Thu, 20 Sep 2012 18:01:18 +0200 Subject: [PATCH] Minor code layout. --- lib/neography/rest/batch.rb | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/neography/rest/batch.rb b/lib/neography/rest/batch.rb index 588fc7e..598b85f 100644 --- a/lib/neography/rest/batch.rb +++ b/lib/neography/rest/batch.rb @@ -44,30 +44,30 @@ def get_batch(args) def get_node(args) { :method => "GET", - :to => Nodes.base_path(:id => get_id(args[1])) + :to => Nodes.base_path(:id => get_id(args[1])) } end def create_node(args) { :method => "POST", - :to => Nodes.index_path, - :body => args[1] + :to => Nodes.index_path, + :body => args[1] } end def delete_node(args) { :method => "DELETE", - :to => Nodes.base_path(:id => get_id(args[1])) + :to => Nodes.base_path(:id => get_id(args[1])) } end def create_unique_node(args) { :method => "POST", - :to => NodeIndexes.unique_path(:index => args[1]), - :body => { + :to => NodeIndexes.unique_path(:index => args[1]), + :body => { :key => args[2], :value => args[3], :properties => args[4] @@ -78,8 +78,8 @@ def create_unique_node(args) def add_node_to_index(args) { :method => "POST", - :to => "/index/node/#{args[1]}", - :body => { + :to => "/index/node/#{args[1]}", + :body => { :uri => build_node_uri(args[4]), :key => args[2], :value => args[3] @@ -136,15 +136,15 @@ def get_node_relationships(args) def get_relationship(args) { :method => "GET", - :to => Relationships.base_path(:id => get_id(args[1])) + :to => Relationships.base_path(:id => get_id(args[1])) } end def create_relationship(args) { :method => "POST", - :to => build_node_uri(args[2]) + "/relationships", - :body => { + :to => build_node_uri(args[2]) + "/relationships", + :body => { :to => build_node_uri(args[3]), :type => args[1], :data => args[4] @@ -162,8 +162,8 @@ def delete_relationship(args) def create_unique_relationship(args) { :method => "POST", - :to => "/index/relationship/#{args[1]}?unique", - :body => { + :to => "/index/relationship/#{args[1]}?unique", + :body => { :key => args[2], :value => args[3], :type => args[4], @@ -176,8 +176,8 @@ def create_unique_relationship(args) def add_relationship_to_index(args) { :method => "POST", - :to => "/index/relationship/#{args[1]}", - :body => { + :to => "/index/relationship/#{args[1]}", + :body => { :uri => build_relationship_uri(args[4]), :key => args[2], :value => args[3] @@ -211,8 +211,8 @@ def reset_relationship_properties(args) def execute_query(args) request = { :method => "POST", - :to => @connection.cypher_path, - :body => { + :to => @connection.cypher_path, + :body => { :query => args[1] } }