Sha256: 08be0b8757e705206474be1f5754822b7ef6701fa467a7371396406a9cab7fac

Contents?: true

Size: 1.26 KB

Versions: 16

Compression:

Stored size: 1.26 KB

Contents

# encoding: utf-8   

# subtable.rb: Yo dawg.
#
# Copyright January 2010, Brad Ediger. All Rights Reserved.
#
# This is free software. Please see the LICENSE and COPYING files for details.
module Prawn
  class Table
    class Cell

      # A Cell that contains another table.
      #
      class Subtable < Cell

        attr_reader :subtable

        def initialize(pdf, point, options={})
          super
          @subtable = options[:content]

          # Subtable padding defaults to zero
          @padding = [0, 0, 0, 0]
        end

        # Sets the text color of the entire subtable.
        #
        def text_color=(color)
          @subtable.cells.text_color = color
        end

        # Proxied to subtable.
        #
        def natural_content_width
          @subtable.cells.width
        end

        # Proxied to subtable.
        #
        def min_width
          @subtable.cells.min_width
        end

        # Proxied to subtable.
        #
        def max_width
          @subtable.cells.max_width
        end

        # Proxied to subtable. 
        #
        def natural_content_height
          @subtable.cells.height
        end

        # Draws the subtable.
        #
        def draw_content
          @subtable.draw
        end

      end
    end
  end
end

Version data entries

16 entries across 16 versions & 6 rubygems

Version Path
prawn-1.0.0.rc2 lib/prawn/table/cell/subtable.rb
nurettin-prawn-1.0.0.rc1 lib/prawn/table/cell/subtable.rb
prawn-1.0.0.rc1 lib/prawn/table/cell/subtable.rb
prawn-0.12.0 lib/prawn/table/cell/subtable.rb
prawn-0.11.1 lib/prawn/table/cell/subtable.rb
davebenvenuti-prawn-0.11.1.pre lib/prawn/table/cell/subtable.rb
piglop-prawn-0.10.2.3 lib/prawn/table/cell/subtable.rb
piglop-prawn-0.10.2.2 lib/prawn/table/cell/subtable.rb
piglop-prawn-0.10.2.1 lib/prawn/table/cell/subtable.rb
prawn-0.11.1.pre lib/prawn/table/cell/subtable.rb
goodwill-prawn-edge-0.10.0 lib/prawn/table/cell/subtable.rb
alphasights-prawn-0.10.4 lib/prawn/table/cell/subtable.rb
alphasights-prawn-0.10.3 lib/prawn/table/cell/subtable.rb
alphasights-prawn-0.10.2 lib/prawn/table/cell/subtable.rb
alphasights-prawn-0.10.1 lib/prawn/table/cell/subtable.rb
alphasights-prawn-0.10.0 lib/prawn/table/cell/subtable.rb