Class: Elasticsearch::Model::Extensions::AssociationPathFinding::ShortestPath::Node

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/elasticsearch/model/extensions/association_path_finding/shortest_path.rb

Direct Known Subclasses

MappingNode

Instance Method Summary collapse

Instance Method Details

#breadth_first_search(&block) ⇒ Object



43
44
45
# File 'lib/elasticsearch/model/extensions/association_path_finding/shortest_path.rb', line 43

def breadth_first_search(&block)
  ShortestPath.breadth_first_search self, &block
end

#each(&block) ⇒ Object



11
12
13
# File 'lib/elasticsearch/model/extensions/association_path_finding/shortest_path.rb', line 11

def each(&block)
  raise "A required method #{self.class}#each is not implemented."
end

#each_with_name(&block) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/elasticsearch/model/extensions/association_path_finding/shortest_path.rb', line 19

def each_with_name(&block)
  iterator = each.lazy.map do |edge|
    [edge, edge.name]
  end

  if block.nil?
    iterator
  else
    iterator.each(&block)
  end
end

#edge_classObject



39
40
41
# File 'lib/elasticsearch/model/extensions/association_path_finding/shortest_path.rb', line 39

def edge_class
  ShortestPath::Edge
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/elasticsearch/model/extensions/association_path_finding/shortest_path.rb', line 35

def eql?(other)
  self.class == other.class && (name.eql? other.name)
end

#hashObject



31
32
33
# File 'lib/elasticsearch/model/extensions/association_path_finding/shortest_path.rb', line 31

def hash
  name.hash
end

#nameObject



15
16
17
# File 'lib/elasticsearch/model/extensions/association_path_finding/shortest_path.rb', line 15

def name
  raise "A required method #{self.class}#name is not implemented."
end