Sha256: 1269bb0f0b6e31e424c410844511131783684540413f2599ea57a72785960a15

Contents?: true

Size: 1.27 KB

Versions: 12

Compression:

Stored size: 1.27 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.
      #
      # @private
      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

12 entries across 12 versions & 2 rubygems

Version Path
prawn-table-0.2.2 lib/prawn/table/cell/subtable.rb
prawn-table-0.2.1 lib/prawn/table/cell/subtable.rb
prawn-table-0.2.0 lib/prawn/table/cell/subtable.rb
prawn-table-0.1.2 lib/prawn/table/cell/subtable.rb
prawn-table-0.1.1 lib/prawn/table/cell/subtable.rb
prawn-table-0.1.0 lib/prawn/table/cell/subtable.rb
prawn-table-0.0.4 lib/prawn/table/cell/subtable.rb
prawn-table-0.0.3 lib/prawn/table/cell/subtable.rb
prawn-table-0.0.2 lib/prawn/table/cell/subtable.rb
prawn-table-0.0.1 lib/prawn/table/cell/subtable.rb
prawn-1.1.0 lib/prawn/table/cell/subtable.rb
prawn-1.0.0 lib/prawn/table/cell/subtable.rb