lib/event_store_client/mapper/encrypted.rb
def deserialize(event, skip_decryption: false)
        metadata = serializer.deserialize(event.metadata)
        encryption_schema = metadata['encryption']

        decrypted_data =
          if skip_decryption
            serializer.deserialize(event.data)
          else
            EventStoreClient::DataDecryptor.new(
              data: serializer.deserialize(event.data),
              schema: encryption_schema,
              repository: key_repository
            ).call
          end

        event_class =
          begin
            Object.const_get(event.type)
          rescue NameError
            EventStoreClient.config.default_event_class
          end

        event_class.new(
          skip_validation: true,
          id: event.id,
          type: event.type,
          title: event.title,
          data: decrypted_data,
          metadata: metadata
        )
      end
##
# Decrypts the given event's subset of data.
# General +Event+ instance with encrypted data
# * +#data+ - hash with encrypted values.
# * encryption_metadata - hash with information which data to encrypt and
#   which key should be used as an identifier.
# *Returns*: Specific event class with all data decrypted
Decrypts the given event's subset of data.
General +Event+ instance with encrypted data
+#data+ - hash with encrypted values.
encryption_metadata - hash with information which data to encrypt and
which key should be used as an identifier.
Returns*: Specific event class with all data decrypted
Decrypts the given event ' s subset of data . General + Event + instance with encrypted data + #data + - hash with encrypted values . encryption_metadata - hash with information which data to encrypt and which key should be used as an identifier . Returns * : Specific event class with all data decrypted
def deserialize(event, skip_decryption: false)
        metadata = serializer.deserialize(event.metadata)
        encryption_schema = metadata['encryption']
        decrypted_data =
          if skip_decryption
            serializer.deserialize(event.data)
          else
            EventStoreClient::DataDecryptor.new(
              data: serializer.deserialize(event.data),
              schema: encryption_schema,
              repository: key_repository
            ).call
          end
        event_class =
          begin
            Object.const_get(event.type)
          rescue NameError
            EventStoreClient.config.default_event_class
          end
        event_class.new(
          skip_validation: true,
          id: event.id,
          type: event.type,
          title: event.title,
          data: decrypted_data,
          metadata: metadata
        )
      end
def deserialize ( event , skip_decryption : false ) metadata = serializer . deserialize ( event . metadata ) encryption_schema = metadata [ 'encryption' ] decrypted_data = if skip_decryption serializer . deserialize ( event . data ) else EventStoreClient :: DataDecryptor . new ( data : serializer . deserialize ( event . data ) , schema : encryption_schema , repository : key_repository ) . call end event_class = begin Object . const_get ( event . type ) rescue NameError EventStoreClient . config . default_event_class end event_class . new ( skip_validation : true , id : event . id , type : event . type , title : event . title , data : decrypted_data , metadata : metadata ) end
Decrypts the given event's subset of data.
Decrypts the given event ' s subset of data .
event
skip_decryption