module BrInvoicesPdf::Util::MountParams

Public Instance Methods

address_params(_xml, root_path, local) click to toggle source
# File lib/br_invoices_pdf/util/mount_params.rb, line 14
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
mount(xml, params) click to toggle source
# File lib/br_invoices_pdf/util/mount_params.rb, line 8
def mount(xml, params)
  params.reduce({}) do |response, (param, path)|
    { **response, param => locate_element(xml, path) }
  end
end