module BrInvoicesPdf::Nfce::Parser::Company

Public Instance Methods

emit_root_path(xml) click to toggle source
# File lib/br_invoices_pdf/nfce/parser/company.rb, line 12
def emit_root_path(xml)
  "#{root_path(xml)}/emit"
end
execute(xml) click to toggle source
# File lib/br_invoices_pdf/nfce/parser/company.rb, line 16
def execute(xml)
  path = emit_root_path(xml)
  {
    name: locate_element(xml, "#{path}/xNome"),
    cnpj: locate_element(xml, "#{path}/CNPJ"),
    state_number: locate_element(xml, "#{path}/IE"),
    address: mount(xml, address_params(xml, path, 'Emit'))
  }
end