Module: Jumoku
- Defined in:
- lib/jumoku.rb,
lib/jumoku/version.rb,
lib/jumoku/strategies.rb,
lib/jumoku/builders/tree.rb,
lib/jumoku/support/branch.rb,
lib/jumoku/builders/shared.rb,
lib/jumoku/support/support.rb,
lib/jumoku/builders/extended.rb,
lib/jumoku/classes/tree_classes.rb,
lib/jumoku/builders/arborescence.rb,
lib/jumoku/strategies/edge_labeling.rb,
lib/jumoku/builders/raw_directed_tree.rb,
lib/jumoku/support/ruby_compatibility.rb,
lib/jumoku/builders/raw_undirected_tree.rb,
lib/jumoku/strategies/edge_labeling/simple.rb
Overview
Jumoku provides you with several modules and classes to build and manipulate tree-graphs.
A tree is a structure composed of branches binding nodes. Branches may be directed (arcs) or undirected (edges). When a there is only one general direction (flow), there is a root node, and one or several leaf nodes. A directed, uni-flow tree where each node only branches in once and branches out once is called a path. For more information on what a tree-graph is and how you could make use of it, see the README.
Two basic implementations are available: undirected trees (RawUndirectedTree) and directed trees (RawDirectedTree). They offer limited features, so one will certainly drop to their civilized siblings:
* {Tree} is derived from an undirected tree and sticks to the mathematical
tree definition.
* {Arborescence} is derived from a directed tree and is likely to be used
as the basis to modelize hierarchy structures, such as a family tree, a file browser…
A node can be any Object: there is no “node type”. A nice object “type” to use as a node may be an OpenStruct or an OpenHash (from the Facets library), but really any object is valid.
Jumoku allows you to enable some strategies when creating a new tree. For instance, you may enable an edge/arc labeling strategy, which will cause indexing of branches as they are added. Jumoku provides a few basic strategies mixin, and one may implement custom ones.
Defined Under Namespace
Modules: ArborescenceBuilder, Branch, Extended, RawDirectedTreeBuilder, RawUndirectedTreeBuilder, Shared, Strategies, TreeBuilder Classes: Arborescence, BranchAlreadyExistError, DirectedBranch, ForbiddenCycle, JumokuError, RawDirectedTree, RawTreeError, RawTreeNodeError, RawUndirectedTree, Tree, UndefinedNode, UndirectedBranch
Constant Summary collapse
Instance Method Summary collapse
Instance Method Details
#ruby_18 ⇒ Object
3 4 5 |
# File 'lib/jumoku/support/ruby_compatibility.rb', line 3 def ruby_18 yield end |
#ruby_19 ⇒ Object
7 8 9 |
# File 'lib/jumoku/support/ruby_compatibility.rb', line 7 def ruby_19 false end |