Module: Dagnabit::Vertex::Neighbors
- Defined in:
- lib/dagnabit/vertex/neighbors.rb
Overview
Provides per-vertex connectivity queries.
This module should be included into a class that has been extended by Connectivity. See this module’s spec for example usage.
Instance Method Summary collapse
-
#ancestors ⇒ Array<ActiveRecord::Base>
Finds all ancestors of the receiver object.
-
#children ⇒ Array<ActiveRecord::Base>
Finds all children of the receiver object.
-
#descendants ⇒ Array<ActiveRecord::Base>
Finds all descendants of the receiver object.
-
#parents ⇒ Array<ActiveRecord::Base>
Finds all parents of the receiver object.
-
#roots ⇒ Array<ActiveRecord::Base>
Finds all source vertices of the receiver object.
Instance Method Details
#ancestors ⇒ Array<ActiveRecord::Base>
Finds all ancestors of the receiver object.
22 23 24 |
# File 'lib/dagnabit/vertex/neighbors.rb', line 22 def ancestors self.class.ancestors_of(self) end |
#children ⇒ Array<ActiveRecord::Base>
Finds all children of the receiver object.
38 39 40 |
# File 'lib/dagnabit/vertex/neighbors.rb', line 38 def children self.class.children_of(self) end |
#descendants ⇒ Array<ActiveRecord::Base>
Finds all descendants of the receiver object.
46 47 48 |
# File 'lib/dagnabit/vertex/neighbors.rb', line 46 def descendants self.class.descendants_of(self) end |
#parents ⇒ Array<ActiveRecord::Base>
Finds all parents of the receiver object.
30 31 32 |
# File 'lib/dagnabit/vertex/neighbors.rb', line 30 def parents self.class.parents_of(self) end |
#roots ⇒ Array<ActiveRecord::Base>
Finds all source vertices of the receiver object.
14 15 16 |
# File 'lib/dagnabit/vertex/neighbors.rb', line 14 def roots self.class.roots_of(self) end |