Class: Decidim::DownloadYourDataSerializers::DownloadYourDataConversationSerializer
- Inherits:
-
Exporters::Serializer
- Object
- Exporters::Serializer
- Decidim::DownloadYourDataSerializers::DownloadYourDataConversationSerializer
- Includes:
- ResourceHelper
- Defined in:
- lib/decidim/download_your_data_serializers/download_your_data_conversation_serializer.rb
Instance Method Summary collapse
-
#initialize(conversation) ⇒ DownloadYourDataConversationSerializer
constructor
Public: Initializes the serializer with a conversation.
-
#serialize ⇒ Object
Public: Exports a hash with the serialized data for this conversation.
Methods included from ResourceHelper
#linked_classes_filter_values_for, #linked_classes_for, #resource_locator
Methods inherited from Exporters::Serializer
Constructor Details
#initialize(conversation) ⇒ DownloadYourDataConversationSerializer
Public: Initializes the serializer with a conversation.
10 11 12 |
# File 'lib/decidim/download_your_data_serializers/download_your_data_conversation_serializer.rb', line 10 def initialize(conversation) @conversation = conversation end |
Instance Method Details
#serialize ⇒ Object
Public: Exports a hash with the serialized data for this conversation.
15 16 17 18 19 20 21 22 |
# File 'lib/decidim/download_your_data_serializers/download_your_data_conversation_serializer.rb', line 15 def serialize { id: conversation.id, messages:, created_at: conversation.created_at, updated_at: conversation.updated_at } end |