Sha256: 6cdbc60e26d9a3cd6a61e67eeb7ffb2dbb510888b81eb39b2a4a8802dd118606
Contents?: true
Size: 1.4 KB
Versions: 17
Compression:
Stored size: 1.4 KB
Contents
# frozen_string_literal: true require 'stringio' require 'ox' require 'prawn' require 'prawn/table' require 'chunky_png' require 'rqrcode' require 'barby' require 'barby/barcode/code_128' require 'barby/outputter/png_outputter' require 'barby/outputter/prawn_outputter' require 'br_invoices_pdf/version' require 'br_invoices_pdf/generator' require 'br_invoices_pdf/errors/invalid_document_type' module BrInvoicesPdf @generators = {} module_function Ox.default_options = Ox.default_options.merge(encoding: 'windows-1252') def generate(type, xml, options = {}) generator = @generators[type] raise(Errors::InvalidDocumentType, type) unless generator generator.generate(xml, options) end def register(type, renderer, parser) raise(ArgumentError, "Expected Symbol or String to type. Received #{type.class}") unless valid_type?(type) @generators[type.to_sym] = Generator.new(renderer, parser) end def supported_document_types @generators.keys end def valid_type?(type) type.is_a?(String) || type.is_a?(Symbol) end end require 'br_invoices_pdf/util/xml_locate' require 'br_invoices_pdf/util/nfce_check_urls' require 'br_invoices_pdf/util/mount_params' require 'br_invoices_pdf/util/enum' require 'br_invoices_pdf/util/base_renderer' require 'br_invoices_pdf/util/pdf_renderer' require 'br_invoices_pdf/util/product_table' require 'br_invoices_pdf/cfe' require 'br_invoices_pdf/nfce'
Version data entries
17 entries across 17 versions & 1 rubygems