Method: PDF#walk_index

Defined in:
lib/pdf.rb

#walk_index(indexer, sections) ⇒ Object



151
152
153
154
155
156
157
158
159
160
161
# File 'lib/pdf.rb', line 151

def walk_index(indexer,sections)
  indexer.each_with_index do |i,index|
    sections[index] = {:title=>Utils.clean_text(i.action.title),:page_num=>i.action.dest.page_num}
    child = i.child
    if child.nil? == false
      sub_sections = []
      work_index(child,sub_sections)
      sections[index][:sub_sections] = sub_sections
    end
  end
end