Sha256: 275a3266f5ae05cccabe4982734be313c2b2b5514e10d19099168f1b77708fb5
Contents?: true
Size: 548 Bytes
Versions: 44
Compression:
Stored size: 548 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).run end) ExportData.new(data, "json") end end end end
Version data entries
44 entries across 44 versions & 1 rubygems