Sha256: aee94d887bc694da5b43140cfeca7ba426dc677a2e450c9e7086e65d840bfa41
Contents?: true
Size: 554 Bytes
Versions: 91
Compression:
Stored size: 554 Bytes
Contents
# frozen_string_literal: true require "json" module Decidim module Exporters # Exports a JSON version of a provided hash, given a collection and a # Serializer. class JSON < Exporter # Public: Generates a JSON representation of a collection and a # Serializer. # # Returns an ExportData with the export. def export data = ::JSON.pretty_generate(@collection.map do |resource| @serializer.new(resource).serialize end) ExportData.new(data, "json") end end end end
Version data entries
91 entries across 91 versions & 2 rubygems