Module: Neo4j::Core::Relationship
- Included in:
- Relationship
- Defined in:
- lib/neo4j-core/relationship/relationship.rb,
lib/neo4j-core/relationship/class_methods.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#_end_node ⇒ Object
Same as Java::OrgNeo4jGraphdb::Relationship#getEndNode.
-
#_java_entity ⇒ Object
same as #_java_rel Used so that we have same method for both relationship and nodes.
-
#_java_rel ⇒ Object
Self.
-
#_other_node(node) ⇒ Object
Same as Java::OrgNeo4jGraphdb::Relationship#getOtherNode.
-
#_start_node ⇒ Object
Same as Java::OrgNeo4jGraphdb::Relationship#getStartNode.
- #class ⇒ Object
-
#del ⇒ nil
Deletes the relationship between the start and end node May raise an exception if delete was unsuccessful.
-
#end_node ⇒ Object
Same as Java::OrgNeo4jGraphdb::Relationship#getEndNode but returns the wrapper for it (if it exist).
-
#exist? ⇒ true, false
If the relationship exists.
-
#other_node(node) ⇒ Neo4j::Node
A convenience operation that, given a node that is attached to this relationship, returns the other node.
-
#rel_type ⇒ Symbol
Returns the relationship name.
-
#start_node ⇒ Object
Same as Java::OrgNeo4jGraphdb::Relationship#getStartNode but returns the wrapper for it (if it exist).
Instance Method Details
#_end_node ⇒ Object
Same as Java::OrgNeo4jGraphdb::Relationship#getEndNode
7 8 9 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 7 def _end_node get_end_node end |
#_java_entity ⇒ Object
same as #_java_rel Used so that we have same method for both relationship and nodes
63 64 65 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 63 def _java_entity self end |
#_java_rel ⇒ Object
Returns self.
68 69 70 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 68 def _java_rel self end |
#_other_node(node) ⇒ Object
Same as Java::OrgNeo4jGraphdb::Relationship#getOtherNode
19 20 21 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 19 def _other_node(node) get_other_node(node) end |
#_start_node ⇒ Object
Same as Java::OrgNeo4jGraphdb::Relationship#getStartNode
13 14 15 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 13 def _start_node get_start_node end |
#class ⇒ Object
88 89 90 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 88 def class Neo4j::Relationship end |
#del ⇒ nil
Deletes the relationship between the start and end node May raise an exception if delete was unsuccessful.
27 28 29 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 27 def del delete end |
#end_node ⇒ Object
Same as Java::OrgNeo4jGraphdb::Relationship#getEndNode but returns the wrapper for it (if it exist)
33 34 35 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 33 def end_node _end_node.wrapper end |
#exist? ⇒ true, false
Returns if the relationship exists.
73 74 75 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 73 def exist? Neo4j::Relationship.exist?(self) end |
#other_node(node) ⇒ Neo4j::Node
A convenience operation that, given a node that is attached to this relationship, returns the other node. For example if node is a start node, the end node will be returned, and vice versa. This is a very convenient operation when you’re manually traversing the node space by invoking one of the #rels method on a node. For example, to get the node “at the other end” of a relationship, use the following:
56 57 58 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 56 def other_node(node) _other_node(node._java_node).wrapper end |
#rel_type ⇒ Symbol
Returns the relationship name
84 85 86 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 84 def rel_type getType().name().to_sym end |
#start_node ⇒ Object
Same as Java::OrgNeo4jGraphdb::Relationship#getStartNode but returns the wrapper for it (if it exist)
39 40 41 |
# File 'lib/neo4j-core/relationship/relationship.rb', line 39 def start_node _start_node.wrapper end |