class Thinreports::SectionReport::Renderer::SectionRenderer

Attributes

pdf[R]

Public Class Methods

new(pdf) click to toggle source
# File lib/thinreports/section_report/pdf/renderer/section_renderer.rb, line 14
def initialize(pdf)
  @pdf = pdf
end

Public Instance Methods

render(section) click to toggle source
# File lib/thinreports/section_report/pdf/renderer/section_renderer.rb, line 18
def render(section)
  doc = pdf.pdf

  actual_height = section_height(section)
  doc.bounding_box([0, doc.cursor], width: doc.bounds.width, height: actual_height) do
    section.items.each do |item|
      draw_item(item, (actual_height - section.schema.height))
    end
  end
end

Private Instance Methods

stack_view_renderer() click to toggle source
# File lib/thinreports/section_report/pdf/renderer/section_renderer.rb, line 33
def stack_view_renderer
  @stack_view_renderer ||= Renderer::StackViewRenderer.new(pdf)
end