You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: encryption.rb
    path of file: ./repos/rails_event_store/ruby_event_store/lib/ruby_event_store/mappers/transformation
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module RubyEventStore
  module Mappers
    module Transformation
      class Encryption
        class Leaf
          def self.===(hash)
            hash.keys.sort.eql? %i[cipher identifier iv
    
        def encryption_metadata(data, schema)
          schema.inject({}) do |acc, (key, value)|
            case value
            when Hash
              acc[key] = encryption_metadata(data, value)
            when Proc
              key_identifier = value.call(data)
              encryption_key = key_repository.key_of(key_identifier)
              raise MissingEncryptionKey.new(key_identifier) unless encryption_key
              acc[key] = { cipher: encryption_key.cipher, iv: encryption_key.random_iv, identifier: key_identifier }
            end
            acc
          end