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

module PgEasyReplicate
  class Stats
    REPLICATION_STATE_MAP = {
      "i" => "initializing
    
      def object(group_name)
        stats = replication_stats(group_name)
        group = Group.find(group_name)
        {
          lag_stats: lag_stats(group_name),
          replication_slots: pg_replication_slots(group_name),
          replication_stats: stats,
          replication_stats_count_by_state:
            replication_stats_count_by_state(stats),
          message_lsn_receipts: message_lsn_receipts(group_name),
          sync_started_at: group[:started_at],
          sync_failed_at: group[:failed_at],
          switchover_completed_at: group[:switchover_completed_at],
        }
      end