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: gpo_confirmation.rb
    path of file: ./repos/identity-idp/app/models
    
    the code of the file until where you have to start completion: class GpoConfirmation < ApplicationRecord
  self.table_name = 'usps_confirmations'

  ENTRY_ATTRIBUTES = %i[otp address1 city state zipcode]
  ENTRY_ATTRIBUTES.each do |attr|
    define_method(:"entry_#{attr}") do
      entry[attr]
    end
  end

  validates :entry, presence: true
  validates :entry_otp, :entry_address1, :entry_city, :entry_state, :entry_zipcode, presence: true
  validate :entry_zipcode_is_valid

  ZIP_REGEX = /^(\d{5})[-+]?(\d+)?$/

  # Store the pii as encrypted json
  def entry=(entry_hash)
    @entry = nil
    self[:entry] = enc
    
  def entry=(entry_hash)
    @entry = nil
    self[:entry] = encryptor.encrypt(
      entry_hash.
        dup.
        tap do |h|
          h[:zipcode] = self.class.normalize_zipcode(h[:zipcode]) if h[:zipcode].present?
        end.
        to_json,
    )
  end

  # Read the pii as a decrypted hash
  def entry
    @entry ||= JSON.parse(encryptor.decrypt(self[:entry]), symbolize_names: true)
  end

  def self.normalize_zipcode(zipcode)
    _, zip, plus4 = ZIP_REGEX.match(zipcode&.gsub(/\s/, '')).to_a
    if plus4&.length == 4
      "#{zip}-#{plus4}"
    else
      zip
    end
  end