From 8e33ad75a0987d6632d85f0f5a8d1a0c1c98a155 Mon Sep 17 00:00:00 2001 From: Javad Karabi Date: Thu, 28 Nov 2013 15:43:03 -0600 Subject: [PATCH] allow for Neography::Node.create_unique --- lib/neography/node.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/neography/node.rb b/lib/neography/node.rb index 7d2106c..71f0c1e 100644 --- a/lib/neography/node.rb +++ b/lib/neography/node.rb @@ -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)