Sha256: b4f836d1103e10b9a3c98986a9813206a58df3f2100400d6774d3f5907e2bc68

Contents?: true

Size: 473 Bytes

Versions: 28

Compression:

Stored size: 473 Bytes

Contents

module BrDanfe
  module CceLib
    class NfeKey
      def initialize(pdf, xml)
        @pdf = pdf
        @xml = Nokogiri::XML(xml)
      end

      def render
        @pdf.box(height: 36) do
          @pdf.text I18n.t('cce.key'), size: 8, style: :bold
          @pdf.text nfe_key, pad: 5
        end
      end

      private

      def nfe_key
        node = @xml.css('procEventoNFe > evento > infEvento > chNFe')
        node ? node.text : ''
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
br_danfe-1.0.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.20.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.19.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.18.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.17.8 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.17.7 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.17.6 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.17.5 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.17.4 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.17.3 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.17.2 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.17.1 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.17.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.16.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.15.1 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.15.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.14.5 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.14.4 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.14.3 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.14.2 lib/br_danfe/cce_lib/nfe_key.rb