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

module Gitlab
  module Ci
    module Build
      class Step
        WHEN_ON_FAILURE = 'on_failure'
        WHEN_ON_SUCCESS = 'on_success'
        WHEN_ALWAYS = 'always'

        attr_reader :name
        attr_accessor :script, :timeout, :whe
    
          def from_after_script(job)
            after_script = job.options[:after_script]
            return unless after_script

            self.new(:after_script).tap do |step|
              step.script = after_script
              step.timeout = job.metadata_timeout
              step.when = WHEN_ALWAYS
              step.allow_failure = true
            end
          end