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.
19
20
21
22
23
|
# File 'lib/review/tocprinter.rb', line 19
def initialize(print_upper, param, out = $stdout)
@print_upper = print_upper
@config = param
@out = out
end
|
Class Method Details
.default_upper_level ⇒ Object
15
16
17
|
# File 'lib/review/tocprinter.rb', line 15
def self.default_upper_level
99 end
|
Instance Method Details
#print?(level) ⇒ Boolean
39
40
41
|
# File 'lib/review/tocprinter.rb', line 39
def print?(level)
level <= @print_upper
end
|
#print_book(book) ⇒ Object
25
26
27
|
# File 'lib/review/tocprinter.rb', line 25
def print_book(book)
book.each_part { |part| print_part(part) }
end
|
#print_chapter(chap) ⇒ Object
33
34
35
36
37
|
# File 'lib/review/tocprinter.rb', line 33
def print_chapter(chap)
chap_node = TOCParser.chapter_node(chap)
print_node 1, chap_node
print_children chap_node
end
|
#print_part(part) ⇒ Object
29
30
31
|
# File 'lib/review/tocprinter.rb', line 29
def print_part(part)
part.each_chapter { |chap| print_chapter(chap) }
end
|