Module: Thinreports::BasicReport::Generator::PDF::DrawTemplateItems

Included in:
Document
Defined in:
lib/thinreports/basic_report/generator/pdf/document/draw_template_items.rb

Instance Method Summary collapse

Instance Method Details

#draw_template_items(items) ⇒ Object

Parameters:

  • items (Array<Hash>)


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/thinreports/basic_report/generator/pdf/document/draw_template_items.rb', line 9

def draw_template_items(items)
  items.each do |item_attributes|
    next unless drawable?(item_attributes)

    case item_attributes['type']
    when 'text' then draw_text(item_attributes)
    when 'image' then draw_image(item_attributes)
    when 'rect' then draw_rect(item_attributes)
    when 'ellipse' then draw_ellipse(item_attributes)
    when 'line' then draw_line(item_attributes)
    end
  end
end