Class: Neo4j::Core::Relationship

Inherits:
Object
  • Object
show all
Includes:
Wrappable
Defined in:
lib/neo4j/core/relationship.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Wrappable

included

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_idObject (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

#idObject (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

#propertiesObject (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_idObject (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

#typeObject (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