Skip to content

Commit

Permalink
Minor code layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roel van Dijk committed Sep 20, 2012
1 parent 12488e5 commit 6b8bd1c
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions lib/neography/rest/batch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -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],
Expand All @@ -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]
Expand Down Expand Up @@ -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]
}
}
Expand Down

0 comments on commit 6b8bd1c

Please sign in to comment.