From a079b5a71f449e1ab2e2a9931455e2109495b6df Mon Sep 17 00:00:00 2001 From: Samir Ahmed Date: Tue, 19 Jun 2012 08:15:48 -0700 Subject: [PATCH] Added 2 Operations to Batch Methods to rest.rb Modified the neography/rest.rb 'get_batch' to add a case for :remove_node_from_index :delete_node Both method use the HTTP DELETE Methods and contain no 'body' Did not account for alias :remove_node_index Still need to add tests. --- lib/neography/rest.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/neography/rest.rb b/lib/neography/rest.rb index da7fb4b..4dc816a 100644 --- a/lib/neography/rest.rb +++ b/lib/neography/rest.rb @@ -473,7 +473,15 @@ def get_batch(args) else {:method => "POST", :to => @cypher_path, :body => {:query => args[1]}} end - else + when :remove_node_from_index + case args.size + when 5 then {:method => "DELETE", :to => "/index/node/#{args[1]}/#{args[2]}/#{args[3]}/#{get_id(args[4])}" } + when 4 then {:method => "DELETE", :to => "/index/node/#{args[1]}/#{args[2]}/#{get_id(args[3])}" } + when 3 then {:method => "DELETE", :to => "/index/node/#{args[1]}/#{get_id(args[2])}" } + end + when :delete_node + {:method => "DELETE", :to => "/node/#{get_id(args[1])}"} + else raise "Unknown option #{args[0]}" end end