Sha256: 599e214788bf5afa5fa40327d6bdb2eb91465891f81345b4b94e933862d17599

Contents?: true

Size: 805 Bytes

Versions: 3

Compression:

Stored size: 805 Bytes

Contents

# frozen_string_literal: true

module BrInvoicesPdf
  module Nfce
    module Renderer
      module ProconInfo
        extend Util::BaseRenderer
        extend BaseRenderer

        module_function

        def execute(pdf, data)
          procon_message = data[:additional_variables][:procon_message]

          return if ['', nil].include? procon_message
          box(pdf, [0, pdf.cursor], page_content_width(pdf)) do
            procon_message(pdf, procon_message)
          end
        end

        # :reek:FeatureEnvy
        def procon_message(pdf, message)
          pdf.text("Mensagem de Interesse do Contribuente:\n\n", style: :italic)
          text = "#{message}\n\n"
          pdf.text(text, align: :center)
        end
        private_class_method :procon_message
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
br_invoices_pdf-0.2.18 lib/br_invoices_pdf/nfce/renderer/procon_info.rb
br_invoices_pdf-0.2.17 lib/br_invoices_pdf/nfce/renderer/procon_info.rb
br_invoices_pdf-0.2.16 lib/br_invoices_pdf/nfce/renderer/procon_info.rb