Module: BrInvoicesPdf::Nfce::Parser

Defined in:
lib/br_invoices_pdf/nfce/parser.rb,
lib/br_invoices_pdf/nfce/parser/totals.rb,
lib/br_invoices_pdf/nfce/parser/company.rb,
lib/br_invoices_pdf/nfce/parser/customer.rb,
lib/br_invoices_pdf/nfce/parser/payments.rb,
lib/br_invoices_pdf/nfce/parser/products.rb,
lib/br_invoices_pdf/nfce/parser/additional_info.rb,
lib/br_invoices_pdf/nfce/parser/emission_details.rb

Defined Under Namespace

Modules: AdditionalInfo, Company, Customer, EmissionDetails, Payments, Products, Totals

Constant Summary collapse

PARSERS =
{
  company: Company,
  products: Products,
  payments: Payments,
  customer: Customer,
  totals: Totals,
  additional_info: AdditionalInfo,
  emission_details: EmissionDetails
}.freeze

Class Method Summary collapse

Class Method Details

.parse(xml) ⇒ Object



26
27
28
29
30
# File 'lib/br_invoices_pdf/nfce/parser.rb', line 26

def parse(xml)
  PARSERS.reduce({}) do |response, (param, parser)|
    { **response, param => parser.execute(xml) }
  end
end