Sha256: f5298052b6b0812d5f524249eb8c1a960210a1ac7774dcd3e96f57ab3602c93a

Contents?: true

Size: 448 Bytes

Versions: 2

Compression:

Stored size: 448 Bytes

Contents

# frozen_string_literal: true

module BrInvoicesPdf
  module Util
    module XmlLocate
      module_function

      ROOT_PATH = 'NFe/infNFe'

      def locate_element(xml, path)
        element = xml.locate(path).first
        element.text if element.is_a?(Ox::Element)
      end

      def node_locate(element, path)
        value = element.nodes.first.locate(path).first
        value.text if value.is_a?(Ox::Element)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
br_invoices_pdf-0.2.7 lib/br_invoices_pdf/util/xml_locate.rb
br_invoices_pdf-0.2.6.alpha.19 lib/br_invoices_pdf/util/xml_locate.rb