Class: Asciidoctor::PDF::SectionInfoByPage

Inherits:
Object
  • Object
show all
Defined in:
lib/asciidoctor/pdf/section_info_by_page.rb

Instance Method Summary collapse

Constructor Details

#initialize(title_method) ⇒ SectionInfoByPage

Returns a new instance of SectionInfoByPage.



6
7
8
9
# File 'lib/asciidoctor/pdf/section_info_by_page.rb', line 6

def initialize title_method
  @table = {}
  @title_method = title_method
end

Instance Method Details

#[](pgnum) ⇒ Object



19
20
21
# File 'lib/asciidoctor/pdf/section_info_by_page.rb', line 19

def [] pgnum
  @table[pgnum]
end

#[]=(pgnum, val) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/asciidoctor/pdf/section_info_by_page.rb', line 11

def []= pgnum, val
  if ::Asciidoctor::Section === val
    @table[pgnum] = { title: val.send(*@title_method), numeral: val.numeral }
  else
    @table[pgnum] = { title: val }
  end
end