Class: EvilEvents::Core::Events::Serializers::Base::EventSerializationState Private
- Inherits:
-
Object
- Object
- EvilEvents::Core::Events::Serializers::Base::EventSerializationState
- Defined in:
- lib/evil_events/core/events/serializers/base/event_serialization_state.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 collapse
- #id ⇒ String, ... readonly private
- #metadata ⇒ ::Hash readonly private
- #payload ⇒ ::Hash readonly private
- #type ⇒ String readonly private
Class Method Summary collapse
- .build_from_event(event) ⇒ EventSerializationState private
- .build_from_options(**options) ⇒ EventSerializationState private
Instance Method Summary collapse
-
#initialize(id:, type:, payload:, metadata:) ⇒ EventSerializationState
constructor
private
A new instance of EventSerializationState.
- #valid? ⇒ Boolean private
Constructor Details
#initialize(id:, type:, payload:, metadata:) ⇒ EventSerializationState
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.
Returns a new instance of EventSerializationState.
61 62 63 64 65 66 |
# File 'lib/evil_events/core/events/serializers/base/event_serialization_state.rb', line 61 def initialize(id:, type:, payload:, metadata:) @id = id @type = type @payload = payload = end |
Instance Attribute Details
#id ⇒ String, ... (readonly)
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.
34 35 36 |
# File 'lib/evil_events/core/events/serializers/base/event_serialization_state.rb', line 34 def id @id end |
#metadata ⇒ ::Hash (readonly)
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.
52 53 54 |
# File 'lib/evil_events/core/events/serializers/base/event_serialization_state.rb', line 52 def end |
#payload ⇒ ::Hash (readonly)
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.
46 47 48 |
# File 'lib/evil_events/core/events/serializers/base/event_serialization_state.rb', line 46 def payload @payload end |
#type ⇒ String (readonly)
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.
40 41 42 |
# File 'lib/evil_events/core/events/serializers/base/event_serialization_state.rb', line 40 def type @type end |
Class Method Details
.build_from_event(event) ⇒ EventSerializationState
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.
13 14 15 |
# File 'lib/evil_events/core/events/serializers/base/event_serialization_state.rb', line 13 def build_from_event(event) new(id: event.id, type: event.type, payload: event.payload, metadata: event.) end |
.build_from_options(**options) ⇒ EventSerializationState
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.
25 26 27 |
# File 'lib/evil_events/core/events/serializers/base/event_serialization_state.rb', line 25 def (**) new(**) end |
Instance Method Details
#valid? ⇒ Boolean
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.
72 73 74 75 76 77 78 |
# File 'lib/evil_events/core/events/serializers/base/event_serialization_state.rb', line 72 def valid? return false unless type && payload && return false unless payload.is_a?(::Hash) return false unless .is_a?(::Hash) return false unless type.is_a?(String) true end |