Module: Neoon::Model::Node
- Defined in:
- lib/neoon/model/node.rb
Instance Method Summary collapse
- #neo_create ⇒ Object (also: #neo_save, #neo_update)
- #neo_destroy ⇒ Object
- #neo_node ⇒ Object
- #neo_node_properties ⇒ Object
Instance Method Details
#neo_create ⇒ Object 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_destroy ⇒ Object
20 21 22 |
# File 'lib/neoon/model/node.rb', line 20 def neo_destroy _cypher_query.delete_node.result.data end |
#neo_node ⇒ Object
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_properties ⇒ Object
24 25 26 |
# File 'lib/neoon/model/node.rb', line 24 def neo_node_properties _neo_node.merge(:_id => self.id) end |