class BrDanfe::Danfe

Public Class Methods

new(xmls) click to toggle source
# File lib/br_danfe/danfe.rb, line 3
def self.new(xmls)
  xmls = [xmls] unless xmls.is_a?(Array)

  parsed_xmls = xmls.map { |xml| BrDanfe::XML.new(xml) }

  create_danfe(parsed_xmls)
end

Private Class Methods

create_danfe(xmls) click to toggle source
# File lib/br_danfe/danfe.rb, line 11
def self.create_danfe(xmls)
  BrDanfe::Helper.nfe?(xmls.first) ? DanfeLib::Nfe.new(xmls) : DanfeLib::Nfce.new(xmls)
end