Sha256: 5e7a6384bf8fa20391350466ecfdafb1aaa2469ba3d5fac01f8b725fed121ae7

Contents?: true

Size: 503 Bytes

Versions: 37

Compression:

Stored size: 503 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    module Import
      # A factory class providing easier way to create new importers.
      class ImporterFactory
        def self.build(file, mime_type, **keyword_args)
          reader = Readers.search_by_mime_type(mime_type)
          raise NotImplementedError, "No reader implemented for mime type: #{mime_type}" if reader.nil?

          Importer.new(file: file, reader: reader, **keyword_args)
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
decidim-admin-0.27.9 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.27.8 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.27.7 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.27.6 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.26.10 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.26.9 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.27.5 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.26.8 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.27.4 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.27.3 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.26.7 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.26.5 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.27.2 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.27.1 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.26.4 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.27.0 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.26.3 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.27.0.rc2 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.27.0.rc1 lib/decidim/admin/import/importer_factory.rb
decidim-admin-0.26.2 lib/decidim/admin/import/importer_factory.rb