Module: Mongoid::Graph

Extended by:
ActiveSupport::Concern
Defined in:
lib/mongoid/graph.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#connect_to(node) ⇒ Object



12
13
14
15
16
17
# File 'lib/mongoid/graph.rb', line 12

def connect_to(node)
  unless self._neighbours.include?(node.node_index)
    self._neighbours << node.node_index
    node._neighbours << self.node_index
  end
end