secret
Created

  • Download Gist
packingslip.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# coding: utf-8
 
class PackingSlip < Prawn::Document
# recognized options
# :needs_cover_page => true|false
def initialize(orders, options = {})
super(:page_layout => :portrait)
@orders = orders
@options = options
 
default_leading 5
 
cover_page if cover_page_needed?
 
@orders.each do |order|
order_page(order)
start_new_page unless order == orders.last
end
end
 
# ...
 
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.