Method: CRDT::ORGraph#create_vertex

Defined in:
lib/crdt/or_graph.rb

#create_vertexObject

Add a new vertex to the graph



46
47
48
49
50
51
# File 'lib/crdt/or_graph.rb', line 46

def create_vertex
  token = issue_token
  # the edge arrays are a performance optimization to provide O(1) lookup for edges by vertex
  @vertices[token] = { incoming_edges: [], outgoing_edges: [], removed: false }
  return token
end