Sha256: 9d1663a98332e916347c17fc955f72f5e1199a57e94f9f87a0817ddc24db060d

Contents?: true

Size: 479 Bytes

Versions: 27

Compression:

Stored size: 479 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")
        return node ? node.text : ""
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
br_danfe-0.11.1 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.11.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.10.1 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.10.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.8.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.7.7 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.7.6 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.7.5 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.7.4 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.7.3 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.7.2 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.7.1 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.7.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.6.1 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.6.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.5.2 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.5.1 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.5.0 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.4.3 lib/br_danfe/cce_lib/nfe_key.rb
br_danfe-0.4.2 lib/br_danfe/cce_lib/nfe_key.rb