Sha256: e29254ccf66f398444e58cb3e461cf704e1624b75d114ec40215a651f7ee4c1a

Contents?: true

Size: 1.31 KB

Versions: 5

Compression:

Stored size: 1.31 KB

Contents

# coding: utf-8

module ThinReports
  module Core::Shape
    
    class List::SectionInterface < Base::Interface
      include Core::Shape::Manager::Target
      
      undef_method :list
      internal_delegators :height
      
      # @param [ThinReports::Core::Shape::List::Page] parent
      # @param [ThinReports::Core::Shape::List::SectionFormat] format
      # @param [Symbol] section_name
      def initialize(parent, format, section_name)
        super(parent, format)
        internal.section_name = section_name
        
        initialize_manager(format) do |f|
          Core::Shape::Interface(self, f)
        end
      end
      
      # @param [ThinReports::Core::Shape::List::Page] parent
      # @return [ThinReports::Core::Shape::List::SectionInterface]
      # @private
      def copy(parent)
        new_sec = super
        new_sec.internal.section_name = internal.section_name
        
        manager.shapes.each do |id, shape|
          new_sec.manager.shapes[id] = shape.copy(new_sec)
        end
        new_sec
      end
      
    private
      
      # @param parent (see #initialize)
      # @param format (see #initialize)
      # @return [ThinReports::Core::Shape::List::SectionInternal]
      def init_internal(parent, format)
        List::SectionInternal.new(parent, format)
      end
    end
    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
thinreports-0.7.7 lib/thinreports/core/shape/list/section_interface.rb
thinreports-0.7.6 lib/thinreports/core/shape/list/section_interface.rb
thinreports-0.7.5 lib/thinreports/core/shape/list/section_interface.rb
thinreports-0.7.0 lib/thinreports/core/shape/list/section_interface.rb
thinreports-0.6.0.pre3 lib/thinreports/core/shape/list/section_interface.rb