Sha256: fb7c770e39c299642a3c9ddb1a311b35c9a29b001e3770c6e92a2db16b57cd8d

Contents?: true

Size: 382 Bytes

Versions: 16

Compression:

Stored size: 382 Bytes

Contents

module BrDanfe
  class Danfe
    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

    def self.create_danfe(xmls)
      BrDanfe::Helper.nfe?(xmls.first) ? DanfeLib::Nfe.new(xmls) : DanfeLib::Nfce.new(xmls)
    end
    private_class_method :create_danfe
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
br_danfe-1.0.0 lib/br_danfe/danfe.rb
br_danfe-0.20.0 lib/br_danfe/danfe.rb
br_danfe-0.19.0 lib/br_danfe/danfe.rb
br_danfe-0.18.0 lib/br_danfe/danfe.rb
br_danfe-0.17.8 lib/br_danfe/danfe.rb
br_danfe-0.17.7 lib/br_danfe/danfe.rb
br_danfe-0.17.6 lib/br_danfe/danfe.rb
br_danfe-0.17.5 lib/br_danfe/danfe.rb
br_danfe-0.17.4 lib/br_danfe/danfe.rb
br_danfe-0.17.3 lib/br_danfe/danfe.rb
br_danfe-0.17.2 lib/br_danfe/danfe.rb
br_danfe-0.17.1 lib/br_danfe/danfe.rb
br_danfe-0.17.0 lib/br_danfe/danfe.rb
br_danfe-0.16.0 lib/br_danfe/danfe.rb
br_danfe-0.15.1 lib/br_danfe/danfe.rb
br_danfe-0.15.0 lib/br_danfe/danfe.rb