Module: Constree
- Defined in:
- lib/constree.rb,
lib/constree/node.rb,
lib/constree/version.rb
Defined Under Namespace
Classes: Node, NodeWithAncestors
Constant Summary
collapse
- VERSION =
"0.1.8"
Class Method Summary
collapse
Class Method Details
.html_of(mod) ⇒ Object
25
26
27
|
# File 'lib/constree.rb', line 25
def html_of mod
list(mod).first.tree_html_full
end
|
.list(node, seen = []) ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/constree.rb', line 8
def list node, seen=[]
node = Node.new node unless node.is_a? Node
seen << node if seen.empty?
node.sub_nodes.each do |sub_n|
seen << sub_n
node.children_for_tree_graph << sub_n
list(sub_n, seen) if sub_n.not_yet? seen
end
seen
end
|
.of(mod) ⇒ Object
21
22
23
|
# File 'lib/constree.rb', line 21
def of mod
list(mod).first.tree_graph
end
|
.p(mod) ⇒ Object
29
30
31
|
# File 'lib/constree.rb', line 29
def p mod
puts of mod
end
|