Class: EvilEvents::Core::Events::Serializers::Hash::Packer Private

Inherits:
Base::DataTransformer show all
Defined in:
lib/evil_events/core/events/serializers/hash/packer.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.

Since:

  • 0.4.0

Instance Attribute Summary

Attributes inherited from Base::DataTransformer

#engine

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(event) ⇒ String

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.

Parameters:

Returns:

  • (String)

Raises:

See Also:

Since:

  • 0.4.0



16
17
18
19
20
21
22
23
# File 'lib/evil_events/core/events/serializers/hash/packer.rb', line 16

def call(event)
  unless event.is_a?(EvilEvents::Core::Events::AbstractEvent)
    raise EvilEvents::HashSerializationError
  end

  serialization_state = build_serialization_state(event)
  engine.dump(serialization_state)
end