Sha256: 613370c8b745c2d843281d676e9ed54f7b466277b196f5f986c737d561651f29

Contents?: true

Size: 1.01 KB

Versions: 3

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

3 entries across 3 versions & 1 rubygems

Version Path
thinreports-0.7.6 lib/thinreports/generator/pdf/drawer/list.rb
thinreports-0.7.5 lib/thinreports/generator/pdf/drawer/list.rb
thinreports-0.7.0 lib/thinreports/generator/pdf/drawer/list.rb