Sha256: 62e9335728a624dd08c8858e4273be34d5a09d99ccb452813cc93266c6d0e190
Contents?: true
Size: 682 Bytes
Versions: 6
Compression:
Stored size: 682 Bytes
Contents
module Prawn module Chunkable def chunk(*a, &b) Prawn::Core::Chunk.new(*a, &b) end def find_chunks(params) if params[:command] chunks.select { |c| c.command == params[:command] } end end def to_pdf rendered = @chunks.map do |chunk| chunk.to_pdf end rendered.join("\n") end module ClassMethods def chunk_methods(*names) names.each do |name| module_eval %{ def #{name}(*a, &b) chunks << #{name}!(*a, &b) end } end end end def self.included(base) base.extend(ClassMethods) end end end
Version data entries
6 entries across 6 versions & 2 rubygems