Skip to content

Commit

Permalink
Merge pull request #120 from karabijavad/create_unique_node
Browse files Browse the repository at this point in the history
allow for Neography::Node.create_unique
  • Loading branch information
maxdemarzi committed Nov 29, 2013
2 parents ae0725b + 8e33ad7 commit 6674228
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/neography/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ def create(props = nil, db = Neography::Rest.new)
node
end

def create_unique(index, key, value, props = nil, db = Neography::Rest.new)
raise ArgumentError.new("syntax deprecated") if props.is_a?(Neography::Rest)

node = self.new(db.create_unique_node(index, key, value, props))
node.neo_server = db
node
end

def load(node, db = Neography::Rest.new)
raise ArgumentError.new("syntax deprecated") if node.is_a?(Neography::Rest)
node = node.first if node.kind_of?(Array)
Expand Down

0 comments on commit 6674228

Please sign in to comment.