Module: BrInvoicesPdf::Nfce::Parser::Company
Class Method Summary
collapse
locate_element, node_locate, root_path
mount
Class Method Details
.emit_root_path(xml) ⇒ Object
12
13
14
|
# File 'lib/br_invoices_pdf/nfce/parser/company.rb', line 12
def emit_root_path(xml)
"#{root_path(xml)}/emit"
end
|
.execute(xml) ⇒ Object
16
17
18
19
20
21
22
23
24
|
# 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
|