Class: Decidim::Exporters::Exporter
- Inherits:
-
Object
- Object
- Decidim::Exporters::Exporter
- Defined in:
- lib/decidim/exporters/exporter.rb
Overview
Abstract class providing the interface and partial implementation of an exporter. See ‘Decidim::Exporters::JSON` and `Decidim::Exporters::CSV` for a reference implementation.
Instance Method Summary collapse
-
#export ⇒ Object
Public: Should generate an ‘ExportData` with the result of the export.
-
#initialize(collection, serializer = Serializer) ⇒ Exporter
constructor
Public: Initializes an Exporter.
Constructor Details
#initialize(collection, serializer = Serializer) ⇒ Exporter
Public: Initializes an Exporter.
collection - An Array with the collection to be exported. serializer - A Serializer to be used during the export.
13 14 15 16 |
# File 'lib/decidim/exporters/exporter.rb', line 13 def initialize(collection, serializer = Serializer) @collection = collection @serializer = serializer end |
Instance Method Details
#export ⇒ Object
Public: Should generate an ‘ExportData` with the result of the export. Responsibility of the subclass.
20 21 22 |
# File 'lib/decidim/exporters/exporter.rb', line 20 def export raise NotImplementedError end |