Class: Neo4j::Core::Relationship
- Inherits:
-
Object
- Object
- Neo4j::Core::Relationship
- Includes:
- Wrappable
- Defined in:
- lib/neo4j/core/relationship.rb
Instance Attribute Summary collapse
-
#end_node_id ⇒ Object
readonly
Returns the value of attribute end_node_id.
-
#id ⇒ Object
(also: #neo_id)
readonly
Returns the value of attribute id.
-
#properties ⇒ Object
(also: #props)
readonly
Returns the value of attribute properties.
-
#start_node_id ⇒ Object
readonly
Returns the value of attribute start_node_id.
-
#type ⇒ Object
(also: #rel_type)
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, type, properties, start_node_id = nil, end_node_id = nil) ⇒ Relationship
constructor
A new instance of Relationship.
Methods included from Wrappable
Constructor Details
#initialize(id, type, properties, start_node_id = nil, end_node_id = nil) ⇒ Relationship
Returns a new instance of Relationship.
14 15 16 17 18 19 20 |
# File 'lib/neo4j/core/relationship.rb', line 14 def initialize(id, type, properties, start_node_id = nil, end_node_id = nil) @id = id @type = type.to_sym unless type.nil? @properties = properties.symbolize_keys @start_node_id = start_node_id @end_node_id = end_node_id end |
Instance Attribute Details
#end_node_id ⇒ Object (readonly)
Returns the value of attribute end_node_id.
7 8 9 |
# File 'lib/neo4j/core/relationship.rb', line 7 def end_node_id @end_node_id end |
#id ⇒ Object (readonly) Also known as: neo_id
Returns the value of attribute id.
7 8 9 |
# File 'lib/neo4j/core/relationship.rb', line 7 def id @id end |
#properties ⇒ Object (readonly) Also known as: props
Returns the value of attribute properties.
7 8 9 |
# File 'lib/neo4j/core/relationship.rb', line 7 def properties @properties end |
#start_node_id ⇒ Object (readonly)
Returns the value of attribute start_node_id.
7 8 9 |
# File 'lib/neo4j/core/relationship.rb', line 7 def start_node_id @start_node_id end |
#type ⇒ Object (readonly) Also known as: rel_type
Returns the value of attribute type.
7 8 9 |
# File 'lib/neo4j/core/relationship.rb', line 7 def type @type end |
Class Method Details
.from_url(url, properties = {}) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/neo4j/core/relationship.rb', line 23 def from_url(url, properties = {}) id = url.split('/')[-1].to_i type = nil # unknown properties = properties new(id, type, properties, nil, nil) end |