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: registry_notification.rb
    path of file: ./repos/Portus/lib/portus
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Portus
  # Handle an event as given by the Registry and processes it so it can be
  # consumed later on.
  class RegistryNotification
    # An array with the events that a handler has to support.
    HANDLED_EVENTS = %w[push delete pull].freeze

    # It filters the event from the registry so the background job can actually
    # handle this request.
    def self.process!(data)
      data["events"].each do |event|
        Rails.logger.debug "Filtering event:\n#{JSON.pretty_generate(
    
    def self.process!(data)
      data["events"].each do |event|
        Rails.logger.debug "Filtering event:\n#{JSON.pretty_generate(event)}"

        # Skip irrelevant or already-handled events.
        next unless should_handle?(event)

        # At this point, events will be handled by
        # ::Portus::Background::RegistryEvent. So just create the event on the
        # DB and let the background process fetch this.
        RegistryEvent.create!(
          event_id: event["id"],
          data:     event.to_json,
          status:   RegistryEvent.statuses[:fresh]
        )
      end
    end