Sha256: 85dd1781d01c82866fd9efe1505f9c10b4efeba78b08fb12933f49c8aa7af38f

Contents?: true

Size: 598 Bytes

Versions: 1

Compression:

Stored size: 598 Bytes

Contents

require 'ox'
require 'prawn'

require 'br_invoices_pdf/version'
require 'br_invoices_pdf/generator'
require 'br_invoices_pdf/errors/invalid_document_type'

module BrInvoicesPdf
  @generators = {}

  module_function

  def generate(type, xml, options = {})
    generator = @generators[type]
    raise(Errors::InvalidDocumentType, type) unless generator
    generator.generate(xml, options)
  end

  def register(type, renderer, parser)
    @generators[type.to_sym] = Generator.new(renderer, parser)
  end

  def supported_document_types
    @generators.keys
  end
end

require 'br_invoices_pdf/cfe'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
br_invoices_pdf-0.1.5.alpha.10 lib/br_invoices_pdf.rb