Class: Decidim::Importers::Importer

Inherits:
Object
  • Object
show all
Defined in:
app/serializers/decidim/importers/importer.rb

Overview

This class is an abstraction that defines a common and flexible interface in how importers should be called.

Direct Known Subclasses

ParticipatorySpaceComponentsImporter

Instance Method Summary collapse

Instance Method Details

#import(_serialized, _user, _opts = {}) ⇒ Object

Imports the contents of the ‘serialized` argument.

Importers that import JSON will normally accept a JSON valid value for the ‘serialized` argument. This values may be either: object, array, string, number, true, false or null.

Returns: What has been imported.

serialized: The serialized version of the resource to import. user: The Decidim::User that is importing. opts: Extra options that specific subclasses may require.

Raises:

  • (NotImplementedError)


20
21
22
# File 'app/serializers/decidim/importers/importer.rb', line 20

def import(_serialized, _user, _opts = {})
  raise NotImplementedError, "Decidim::Importers::Importer should be subclassed."
end