Object
A Grid represents the entire grid system of a Page and calculates the column width and row height of the base box.
:nodoc
# File lib/prawn/layout/grid.rb, line 39 39: def initialize(pdf, options = {}) 40: valid_options = [:columns, :rows, :gutter, :row_gutter, :column_gutter] 41: Prawn.verify_options valid_options, options 42: 43: @pdf = pdf 44: @columns = options[:columns] 45: @rows = options[:rows] 46: set_gutter(options) 47: end
Calculates the base width of boxes.
# File lib/prawn/layout/grid.rb, line 50 50: def column_width 51: @column_width ||= subdivide(pdf.bounds.width, columns, column_gutter) 52: end
# File lib/prawn/layout/grid.rb, line 74 74: def set_gutter(options) 75: if options.has_key?(:gutter) 76: @gutter = options[:gutter].to_f 77: @row_gutter, @column_gutter = @gutter, @gutter 78: else 79: @row_gutter = options[:row_gutter].to_f 80: @column_gutter = options[:column_gutter].to_f 81: @gutter = 0 82: end 83: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.