Class: ReVIEW::TOCPrinter
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(print_upper, param, out = $stdout) ⇒ TOCPrinter
Returns a new instance of TOCPrinter.
25
26
27
28
29
|
# File 'lib/review/tocprinter.rb', line 25
def initialize(print_upper, param, out = $stdout)
@print_upper = print_upper
@config = param
@out = out
end
|
Class Method Details
.default_upper_level ⇒ Object
21
22
23
|
# File 'lib/review/tocprinter.rb', line 21
def TOCPrinter.default_upper_level
99 end
|
Instance Method Details
#print?(level) ⇒ Boolean
49
50
51
|
# File 'lib/review/tocprinter.rb', line 49
def print?(level)
level <= @print_upper
end
|
#print_book(book) ⇒ Object
31
32
33
34
35
|
# File 'lib/review/tocprinter.rb', line 31
def print_book(book)
book.each_part do |part|
print_part(part)
end
end
|
#print_chapter(chap) ⇒ Object
43
44
45
46
47
|
# File 'lib/review/tocprinter.rb', line 43
def print_chapter(chap)
chap_node = TOCParser.chapter_node(chap)
print_node 1, chap_node
print_children chap_node
end
|
#print_part(part) ⇒ Object
37
38
39
40
41
|
# File 'lib/review/tocprinter.rb', line 37
def print_part(part)
part.each_chapter do |chap|
print_chapter(chap)
end
end
|