Class: Decidim::Meetings::DataPortabilityRegistrationSerializer

Inherits:
Exporters::Serializer show all
Defined in:
decidim-meetings/app/serializers/decidim/meetings/data_portability_registration_serializer.rb

Instance Attribute Summary

Attributes inherited from Exporters::Serializer

#resource

Instance Method Summary collapse

Methods inherited from Exporters::Serializer

#event_name, #finalize, #initialize, #run

Constructor Details

This class inherits a constructor from Decidim::Exporters::Serializer

Instance Method Details

#serializeObject

Serializes a registration for data portability


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'decidim-meetings/app/serializers/decidim/meetings/data_portability_registration_serializer.rb', line 7

def serialize
  {
    id: resource.id,
    code: resource.code,
    user: {
      name: resource.user.name,
      email: resource.user.email
    },
    meeting: {
      title: resource.meeting.title,
      description: resource.meeting.description,
      start_time: resource.meeting.start_time,
      end_time: resource.meeting.end_time,
      address: resource.meeting.address,
      location: resource.meeting.location,
      location_hints: resource.meeting.location_hints,
      reference: resource.meeting.reference,
      attendees_count: resource.meeting.attendees_count,
      attending_organizations: resource.meeting.attending_organizations,
      closed_at: resource.meeting.closed_at,
      closing_report: resource.meeting.closing_report,
      published_at: resource.meeting.published_at
    }
  }
end