Sha256: b67ea0b39553fb50bd657e358c33c44855af954a4a20fa629ea25b6ff2c2394c

Contents?: true

Size: 694 Bytes

Versions: 21

Compression:

Stored size: 694 Bytes

Contents

# frozen_string_literal: true

module BrInvoicesPdf
  module Util
    module MountParams
      module_function

      def mount(xml, params)
        params.reduce({}) do |response, (param, path)|
          { **response, param => locate_element(xml, path) }
        end
      end

      def address_params(_xml, root_path, local)
        {
          streetname: "#{root_path}/ender#{local}/xLgr",
          number: "#{root_path}/ender#{local}/nro",
          district: "#{root_path}/ender#{local}/xBairro",
          city: "#{root_path}/ender#{local}/xMun",
          state: "#{root_path}/ender#{local}/UF"
        }.freeze
      end
      private_class_method :address_params
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
br_invoices_pdf-0.2.24 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.23 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.22 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.21 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.20 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.19 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.18 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.17 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.16 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.15 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.14 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.14.alpha.23 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.13 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.13.alpha.22 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.12.alpha.21 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.12.alpha.20 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.12 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.11 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.10 lib/br_invoices_pdf/util/mount_params.rb
br_invoices_pdf-0.2.9 lib/br_invoices_pdf/util/mount_params.rb