Class: Elasticsearch::Model::Extensions::AssociationPathFinding::ShortestPath::Node
- Inherits:
-
Object
- Object
- Elasticsearch::Model::Extensions::AssociationPathFinding::ShortestPath::Node
- Includes:
- Enumerable
- Defined in:
- lib/elasticsearch/model/extensions/association_path_finding/shortest_path.rb
Direct Known Subclasses
Instance Method Summary collapse
- #breadth_first_search(&block) ⇒ Object
- #each(&block) ⇒ Object
- #each_with_name(&block) ⇒ Object
- #edge_class ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
- #name ⇒ Object
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_class ⇒ Object
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
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 |
#hash ⇒ Object
31 32 33 |
# File 'lib/elasticsearch/model/extensions/association_path_finding/shortest_path.rb', line 31 def hash name.hash end |
#name ⇒ Object
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 |