Class: Yes::Core::Middlewares::WithIndifferentAccess

Inherits:
Object
  • Object
show all
Includes:
PgEventstore::Middleware
Defined in:
lib/yes/core/middlewares/with_indifferent_access.rb

Overview

PgEventstore middleware that converts event data and metadata to HashWithIndifferentAccess, allowing both string and symbol key access.

Instance Method Summary collapse

Instance Method Details

#serialize(event) ⇒ PgEventstore::Event Also known as: deserialize

Parameters:

  • event (PgEventstore::Event)

Returns:

  • (PgEventstore::Event)


13
14
15
16
17
# File 'lib/yes/core/middlewares/with_indifferent_access.rb', line 13

def serialize(event)
  event. = event..with_indifferent_access
  event.data = event.data.with_indifferent_access
  event
end