Class: Elasticsearch::Model::Extensions::ShortestPath::Node
- Inherits:
-
Object
- Object
- Elasticsearch::Model::Extensions::ShortestPath::Node
- Includes:
- Enumerable
- Defined in:
- lib/elasticsearch/model/extensions/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
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_class ⇒ Object
38 39 40 |
# File 'lib/elasticsearch/model/extensions/shortest_path.rb', line 38 def edge_class ShortestPath::Edge end |
#eql?(other) ⇒ 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 |
#hash ⇒ Object
30 31 32 |
# File 'lib/elasticsearch/model/extensions/shortest_path.rb', line 30 def hash name.hash end |
#name ⇒ Object
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 |