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

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

Direct Known Subclasses

MappingNode

Instance Method Summary collapse

Instance Method Details

#breadth_first_search(&block) ⇒ Object



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

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

#each(&block) ⇒ Object



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

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

#each_with_name(&block) ⇒ Object



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

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



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

def edge_class
  ShortestPath::Edge
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#hashObject



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

def hash
  name.hash
end

#nameObject



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

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