Class: Lexster::Relationship::RelationshipLazyProxy

Inherits:
Neography::Relationship
  • Object
show all
Defined in:
lib/lexster/relationship.rb

Overview

this is a proxy that delays loading of start_node and end_node from Neo4j until accessed. the original Neography Relatioship loaded them on initialization

Instance Method Summary collapse

Instance Method Details

#end_nodeObject



10
11
12
# File 'lib/lexster/relationship.rb', line 10

def end_node
  @end_node_from_db ||= @end_node = Neography::Node.load(@end_node, Lexster.db)
end

#start_nodeObject



6
7
8
# File 'lib/lexster/relationship.rb', line 6

def start_node
  @start_node_from_db ||= @start_node = Neography::Node.load(@start_node, Lexster.db)
end