Class: Decidim::Conferences::DownloadYourDataConferenceInviteSerializer

Inherits:
Exporters::Serializer show all
Defined in:
decidim-conferences/app/serializers/decidim/conferences/download_your_data_conference_invite_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 conference invite for download your data



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
32
# File 'decidim-conferences/app/serializers/decidim/conferences/download_your_data_conference_invite_serializer.rb', line 7

def serialize
  {
    id: resource.id,
    sent_at: resource.sent_at,
    accepted_at: resource.accepted_at,
    rejected_at: resource.rejected_at,
    user: {
      name: resource.user.name,
      email: resource.user.email
    },
    registration_type: {
      title: resource.registration_type.title,
      price: resource.registration_type.price
    },
    conference: {
      title: resource.conference.title,
      reference: resource.conference.reference,
      slogan: resource.conference.slogan,
      description: resource.conference.description,
      start_date: resource.conference.start_date,
      end_date: resource.conference.end_date,
      location: resource.conference.location,
      objectives: resource.conference.objectives
    }
  }
end