Class: Thinreports::BasicReport::Generator::PDF::Drawer::List

Inherits:
Base
  • Object
show all
Defined in:
lib/thinreports/basic_report/generator/pdf/drawer/list.rb

Instance Method Summary collapse

Constructor Details

#initialize(pdf, format) ⇒ List

Returns a new instance of List.



10
11
12
13
# File 'lib/thinreports/basic_report/generator/pdf/drawer/list.rb', line 10

def initialize(pdf, format)
  super
  @sections = {}
end

Instance Method Details

#draw(list_page) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/thinreports/basic_report/generator/pdf/drawer/list.rb', line 16

def draw(list_page)
  draw_section(list_page.header) if list_page.header
  list_page.rows.each do |row|
    draw_section(row)
  end

  # Returns Thinreports::BasicReport::Report::Page object
  manager = list_page.parent.manager

  list_id = list_page.id.to_s
  manager.format.shapes.each do |id, shape|
    next unless list_pageno?(list_id, shape)

    shape = manager.final_shape(id)
    @pdf.draw_shape_pageno(shape.internal,
                           list_page.no, list_page.manager.page_count)
  end
end