Class: Comunit::Network::Handlers::PollAnswerHandler

Inherits:
Comunit::Network::Handler show all
Defined in:
app/services/comunit/network/handlers/poll_answer_handler.rb

Overview

Handling polls

Constant Summary

Constants inherited from Comunit::Network::Handler

Comunit::Network::Handler::MAIN_HOST

Instance Attribute Summary

Attributes inherited from Comunit::Network::Handler

#data, #entity

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Comunit::Network::Handler

[], #amend, #entity_class, ignored_attributes, #initialize, #pull, #pull_and_validate, #push, relationship_data

Methods included from Sending

#headers, #rest

Methods included from Logging

#log, #log_error, #log_info, #log_warn

Constructor Details

This class inherits a constructor from Comunit::Network::Handler

Class Method Details

.permitted_attributesObject



8
9
10
# File 'app/services/comunit/network/handlers/poll_answer_handler.rb', line 8

def self.permitted_attributes
  %i[created_at priority text]
end

Instance Method Details

#prepare_model_dataObject



12
13
14
15
16
17
18
19
# File 'app/services/comunit/network/handlers/poll_answer_handler.rb', line 12

def prepare_model_data
  {
    id: entity.uuid,
    type: entity.class.table_name,
    attributes: attributes_for_remote,
    relationships: relationships_for_remote,
  }
end