Sha256: 0cfa476628dd940c9ea5158b076b570fac49d056bf1f7a82bed388ed1608e88f
Contents?: true
Size: 835 Bytes
Versions: 31
Compression:
Stored size: 835 Bytes
Contents
# frozen_string_literal: true module Decidim module Exporters # Abstract class providing the interface and partial implementation # of an exporter. See `Decidim::Exporters::JSON` and `Decidim::Exporters::CSV` # for a reference implementation. class Exporter # Public: Initializes an Exporter. # # collection - An Array with the collection to be exported. # serializer - A Serializer to be used during the export. def initialize(collection, serializer) @collection = collection @serializer = serializer end # Public: Should generate an `ExportData` with the result of the export. # Responsibility of the subclass. def export raise NotImplementedError end private attr_reader :collection, :serializer end end end
Version data entries
31 entries across 31 versions & 2 rubygems