Sha256: 44c5119c7e770a7783627850630c6db1353d2ac118786bb2734a2fa1af797eec

Contents?: true

Size: 744 Bytes

Versions: 38

Compression:

Stored size: 744 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    module Census
      # This class serializes a Voting::Census::Datum
      class DatumSerializer < Decidim::Exporters::Serializer
        include Decidim::ApplicationHelper

        # Public: Initializes the serializer with a Voting::Census::Datum.
        def initialize(datum)
          @datum = datum
        end

        # Public: Exports a hash with the serialized data for this datum.
        def serialize
          {
            full_name: datum.full_name,
            full_address: datum.full_address,
            postal_code: datum.postal_code,
            access_code: datum.access_code
          }
        end

        attr_reader :datum
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.27.9 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.28.3 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.27.8 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.28.2 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.27.7 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.28.1 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.27.6 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.26.10 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.26.9 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.28.0 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.27.5 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.28.0.rc5 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.28.0.rc4 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.26.8 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.27.4 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.27.3 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.26.7 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.26.5 app/serializers/decidim/votings/census/datum_serializer.rb
decidim-elections-0.27.2 app/serializers/decidim/votings/census/datum_serializer.rb