Module: BrInvoicesPdf::Cfe::Parser::FiscoObs

Extended by:
Util::XmlLocate
Defined in:
lib/br_invoices_pdf/cfe/parser/fisco_obs.rb

Class Method Summary collapse

Methods included from Util::XmlLocate

locate_element, node_locate, root_path

Class Method Details

.execute(xml) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/br_invoices_pdf/cfe/parser/fisco_obs.rb', line 11

def execute(xml)
  xml.locate('infCFe/infAdic/obsFisco').map do |element|
    node = element.nodes.first
    field = element.attributes[:xCampo]
    next unless node && field
    {
      text: node.text,
      field: field
    }
  end
end