Class: DiasporaFederation::Federation::Receiver::AbstractReceiver
- Inherits:
-
Object
- Object
- DiasporaFederation::Federation::Receiver::AbstractReceiver
- Includes:
- Logging
- Defined in:
- lib/diaspora_federation/federation/receiver/abstract_receiver.rb
Overview
Common functionality for receivers
Instance Method Summary collapse
-
#initialize(magic_envelope, recipient_id = nil) ⇒ AbstractReceiver
constructor
Creates a new receiver.
-
#receive ⇒ Object
Validates and receives the entity.
Methods included from Logging
Constructor Details
#initialize(magic_envelope, recipient_id = nil) ⇒ AbstractReceiver
Creates a new receiver
13 14 15 16 17 |
# File 'lib/diaspora_federation/federation/receiver/abstract_receiver.rb', line 13 def initialize(magic_envelope, recipient_id=nil) @entity = magic_envelope.payload @sender = magic_envelope.sender @recipient_id = recipient_id end |
Instance Method Details
#receive ⇒ Object
Validates and receives the entity
20 21 22 23 24 25 |
# File 'lib/diaspora_federation/federation/receiver/abstract_receiver.rb', line 20 def receive validate_and_receive rescue => e # rubocop:disable Style/RescueStandardError logger.error "failed to receive #{entity}" raise e end |