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

module Gitlab
  module Pages
    class DeploymentUpdate
      include ActiveModel::Validations

      PUBLIC_DIR = 'public'

      validate :validate_state, unless: -> { errors.any? }
      validate :validate_outdated_sha, unless: -> { errors.any? }
      validate :validate_max_size, unless: -> { errors.any? }
      validate :validate_public_folder, unless: -> { errors.any? }
      val
    
      def entries_count
        # we're using the full archive and pages daemon needs to read it
        # so we want the total count from entries, not only "public/" directory
        # because it better approximates work we need to do before we can serve the site
        @entries_count = build.artifacts_metadata_entry("", recursive: true).entries.count
      end

      private

      attr_reader :build, :project

      def validate_state
        errors.add(:base, 'missing pages artifacts') unless build.artifacts?
        errors.add(:base, 'missing artifacts metadata') unless build.artifacts_metadata?
      end

      def validate_max_size
        if total_size > max_size
          errors.add(:base, "artifacts for pages are too large: #{total_size}")
        end
      end