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

module Gitlab
  module Ci
    class Config
      module External
        class Mapper
          # Handles variable expansion
          class VariablesExpander < Base
            def expand(data)
              if data.is_a
    
            def transform_and_expand_variable(data)
              data.transform_values do |values|
                case values
                when Array
                  values.map { |value| expand_variable(value.to_s) }
                when String
                  expand_variable(values)
                else
                  values
                end
              end