Class: Decidim::Votings::Census::DatumSerializer
- Inherits:
-
Exporters::Serializer
- Object
- Exporters::Serializer
- Decidim::Votings::Census::DatumSerializer
- Includes:
- ApplicationHelper
- Defined in:
- app/serializers/decidim/votings/census/datum_serializer.rb
Overview
This class serializes a Voting::Census::Datum
Instance Attribute Summary collapse
-
#datum ⇒ Object
readonly
Returns the value of attribute datum.
Instance Method Summary collapse
-
#initialize(datum) ⇒ DatumSerializer
constructor
Public: Initializes the serializer with a Voting::Census::Datum.
-
#serialize ⇒ Object
Public: Exports a hash with the serialized data for this datum.
Constructor Details
#initialize(datum) ⇒ DatumSerializer
Public: Initializes the serializer with a Voting::Census::Datum.
11 12 13 |
# File 'app/serializers/decidim/votings/census/datum_serializer.rb', line 11 def initialize(datum) @datum = datum end |
Instance Attribute Details
#datum ⇒ Object (readonly)
Returns the value of attribute datum.
25 26 27 |
# File 'app/serializers/decidim/votings/census/datum_serializer.rb', line 25 def datum @datum end |
Instance Method Details
#serialize ⇒ Object
Public: Exports a hash with the serialized data for this datum.
16 17 18 19 20 21 22 23 |
# File 'app/serializers/decidim/votings/census/datum_serializer.rb', line 16 def serialize { full_name: datum.full_name, full_address: datum.full_address, postal_code: datum.postal_code, access_code: datum.access_code } end |