Sha256: 9b07a5dc575e0d5ea06d41f065c049a514585f1724d00a6e698b14238d86c1b6

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# coding: utf-8

module ThinReports
  module Generator
    
    # @private
    class Pdf::Drawer::List < Pdf::Drawer::Base
      # @param (see Pdf::Drawer::Base#initialize)
      def initialize(pdf, format)
        super
        @sections = {}
      end
      
      # @param [ThinReports::Core::Shape::List::PageState] list
      def draw(list)
        draw_section(list.header) if list.header
        list.rows.each do |row|
          draw_section(row)
        end
      end
      
    private  
      
      # @param [ThinReports::Core::Shape::List::SectionInterface] section
      def draw_section(section)
        internal = section.internal
        drawer(internal).draw(section.manager, internal.relative_position)
      end
      
      # @param [ThinReports::Core::Shape::List::SectionInternal] section
      # @return [ThinReports::Generator::Pdf::Drawer::ListSection]
      def drawer(section)
        @sections[section.section_name] ||=
          Pdf::Drawer::ListSection.new(@pdf, section)
      end
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thinreports-0.6.0.pre3 lib/thinreports/generator/pdf/drawer/list.rb