Skip to content

Commit

Permalink
Added 2 Operations to Batch Methods to rest.rb
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
samirahmed committed Jun 19, 2012
1 parent c7b3c3c commit a079b5a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/neography/rest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a079b5a

Please sign in to comment.