Class: Chronos::Core::SerializedEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/chronos/core/payload_serializer.rb

Overview

Serialized event ready for transport.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



14
15
16
# File 'lib/chronos/core/payload_serializer.rb', line 14

def body
  @body
end

#event_idObject (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

#bytesizeObject



22
23
24
# File 'lib/chronos/core/payload_serializer.rb', line 22

def bytesize
  body.bytesize
end