Class: Chronos::Core::SerializedEvent
- Inherits:
-
Object
- Object
- Chronos::Core::SerializedEvent
- Defined in:
- lib/chronos/core/payload_serializer.rb
Overview
Serialized event ready for transport.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
Instance Method Summary collapse
- #bytesize ⇒ Object
-
#initialize(event_id, body) ⇒ SerializedEvent
constructor
A new instance of SerializedEvent.
Constructor Details
#initialize(event_id, body) ⇒ SerializedEvent
Returns a new instance of SerializedEvent.
16 17 18 19 20 |
# File 'lib/chronos/core/payload_serializer.rb', line 16 def initialize(event_id, body) @event_id = event_id.to_s.freeze @body = body.to_s.freeze freeze end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
14 15 16 |
# File 'lib/chronos/core/payload_serializer.rb', line 14 def body @body end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
14 15 16 |
# File 'lib/chronos/core/payload_serializer.rb', line 14 def event_id @event_id end |
Instance Method Details
#bytesize ⇒ Object
22 23 24 |
# File 'lib/chronos/core/payload_serializer.rb', line 22 def bytesize body.bytesize end |