Module: Neoon::Model::Node

Defined in:
lib/neoon/model/node.rb

Instance Method Summary collapse

Instance Method Details

#neo_createObject Also known as: neo_save, neo_update



14
15
16
# File 'lib/neoon/model/node.rb', line 14

def neo_create
  _cypher_query.create_node.result.data
end

#neo_destroyObject



20
21
22
# File 'lib/neoon/model/node.rb', line 20

def neo_destroy
  _cypher_query.delete_node.result.data
end

#neo_nodeObject



5
6
7
8
9
10
11
12
# File 'lib/neoon/model/node.rb', line 5

def neo_node
  _node = _cypher_query.find_node.result.data
  if _node.empty?
    excep = { :message => "Cannot find node with id [#{_cypher_query.id}] in database.", :exception => "NodeNotFoundException" }
    raise Neoon::Error::NodeNotFoundException.new excep, excep
  end
  _node.first.first.data
end

#neo_node_propertiesObject



24
25
26
# File 'lib/neoon/model/node.rb', line 24

def neo_node_properties
  _neo_node.merge(:_id => self.id)
end