Sha256: e5df9f76f59d3ab1e103ed43658191c190a04784ee0c4f9872e9241ddc4300ff
Contents?: true
Size: 848 Bytes
Versions: 109
Compression:
Stored size: 848 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 = 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
109 entries across 109 versions & 1 rubygems