Sha256: bfe645776527ea62bb20ce47caef2d3a5739d74cb96635da2390bb4b5285efa0

Contents?: true

Size: 518 Bytes

Versions: 6

Compression:

Stored size: 518 Bytes

Contents

# frozen_string_literal: true

module BrInvoicesPdf
  module Cfe
    module Parser
      module FiscoObs
        extend Util::XmlLocate

        module_function

        def execute(xml)
          xml.locate('infCFe/infAdic/obsFisco').map do |element|
            node = element.nodes.first
            field = element.attributes[:xCampo]
            next unless node && field

            {
              text: node.text,
              field: field
            }
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
br_invoices_pdf-0.2.24 lib/br_invoices_pdf/cfe/parser/fisco_obs.rb
br_invoices_pdf-0.2.23 lib/br_invoices_pdf/cfe/parser/fisco_obs.rb
br_invoices_pdf-0.2.22 lib/br_invoices_pdf/cfe/parser/fisco_obs.rb
br_invoices_pdf-0.2.21 lib/br_invoices_pdf/cfe/parser/fisco_obs.rb
br_invoices_pdf-0.2.20 lib/br_invoices_pdf/cfe/parser/fisco_obs.rb
br_invoices_pdf-0.2.19 lib/br_invoices_pdf/cfe/parser/fisco_obs.rb