Class: Neo4j::Driver::Types::UnboundRelationship

Inherits:
Object
  • Object
show all
Defined in:
lib/neo4j/driver/types/unbound_relationship.rb

Overview

Represents an unbound relationship (used in paths before binding to nodes)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, type, properties, element_id = nil) ⇒ UnboundRelationship

Returns a new instance of UnboundRelationship.



10
11
12
13
14
15
# File 'lib/neo4j/driver/types/unbound_relationship.rb', line 10

def initialize(id, type, properties, element_id = nil)
  @id = id
  @type = type
  @properties = properties
  @element_id = element_id || id.to_s
end

Instance Attribute Details

#element_idObject (readonly)

Returns the value of attribute element_id.



8
9
10
# File 'lib/neo4j/driver/types/unbound_relationship.rb', line 8

def element_id
  @element_id
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/neo4j/driver/types/unbound_relationship.rb', line 8

def id
  @id
end

#propertiesObject (readonly)

Returns the value of attribute properties.



8
9
10
# File 'lib/neo4j/driver/types/unbound_relationship.rb', line 8

def properties
  @properties
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/neo4j/driver/types/unbound_relationship.rb', line 8

def type
  @type
end

Instance Method Details

#[](key) ⇒ Object



17
18
19
# File 'lib/neo4j/driver/types/unbound_relationship.rb', line 17

def [](key)
  @properties[key.to_s] || @properties[key.to_sym]
end

#bind(start_node_id, end_node_id, start_node_element_id = nil, end_node_element_id = nil) ⇒ Object

Bind this relationship to specific start and end nodes



22
23
24
25
# File 'lib/neo4j/driver/types/unbound_relationship.rb', line 22

def bind(start_node_id, end_node_id, start_node_element_id = nil, end_node_element_id = nil)
  Relationship.new(@id, start_node_id, end_node_id, @type, @properties,
                   @element_id, start_node_element_id, end_node_element_id)
end