Class: EvilEvents::Core::Events::Serializers::JSON::Unpacker Private
- Inherits:
-
Base::DataTransformer
- Object
- Base::DataTransformer
- EvilEvents::Core::Events::Serializers::JSON::Unpacker
- Defined in:
- lib/evil_events/core/events/serializers/json/unpacker.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary
Attributes inherited from Base::DataTransformer
Instance Method Summary collapse
Methods inherited from Base::DataTransformer
#build_serialization_state, #initialize, #restore_event_instance
Constructor Details
This class inherits a constructor from EvilEvents::Core::Events::Serializers::Base::DataTransformer
Instance Method Details
#call(serialized_event) ⇒ EvilEvents::Core::Events::AbstractEvent
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/evil_events/core/events/serializers/json/unpacker.rb', line 16 def call(serialized_event) raise EvilEvents::JSONDeserializationError unless serialized_event.is_a?(String) begin serialization_state = engine.load(serialized_event) rescue EvilEvents::SerializationEngineError raise EvilEvents::JSONDeserializationError end raise EvilEvents::JSONDeserializationError unless serialization_state.valid? restore_event_instance(serialization_state) end |