Module: Neon::Relationship
- Defined in:
- lib/neon/relationship.rb,
lib/neon/relationship/rest.rb
Defined Under Namespace
Classes: Rest
Class Method Summary collapse
-
.load(id, session = Session.current) ⇒ Relationship
Loads an existing relationship with the given id.
-
.new(start_node, name, end_node, attributes = {}) ⇒ Relationship
Creates a new Relationship and immediately persists it to the database.
Class Method Details
.load(id, session = Session.current) ⇒ Relationship
Loads an existing relationship with the given id
24 25 26 27 28 29 30 |
# File 'lib/neon/relationship.rb', line 24 def load(id, session = Session.current) begin session.load_rel(id) rescue NoMethodError _raise_invalid_session_error(session) end end |
.new(start_node, name, end_node, attributes = {}) ⇒ Relationship
Creates a new Relationship and immediately persists it to the database. All subsequent changes are immediately persisted.
12 13 14 |
# File 'lib/neon/relationship.rb', line 12 def new(start_node, name, end_node, attributes = {}) start_node.create_rel_to(end_node, name, attributes) end |