Sha256: 1d014924cdcbf23643f0be68fc19d970c38653b959290228236e3b2165d212f9

Contents?: true

Size: 902 Bytes

Versions: 84

Compression:

Stored size: 902 Bytes

Contents

# frozen_string_literal: true

module Aws
  module Endpoints
    # This class is deprecated. It is used by the Runtime endpoint
    # resolution approach. It has been replaced by a code generated
    # approach in each service gem. It can be removed in a new
    # major version. It has to exist because
    # old service gems can use a new core version.
    # @api private
    class Reference
      def initialize(ref:)
        @ref = ref
      end

      attr_reader :ref

      def resolve(parameters, assigns)
        if parameters.class.singleton_class::PARAM_MAP.key?(@ref)
          member_name = parameters.class.singleton_class::PARAM_MAP[@ref]
          parameters[member_name]
        elsif assigns.key?(@ref)
          assigns[@ref]
        else
          raise ArgumentError,
                "Reference #{@ref} is not a param or an assigned value."
        end
      end
    end
  end
end

Version data entries

84 entries across 84 versions & 1 rubygems

Version Path
aws-sdk-core-3.217.1 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.217.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.216.1 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.216.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.215.1 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.215.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.214.1 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.214.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.213.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.212.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.211.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.210.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.209.1 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.209.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.208.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.207.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.206.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.205.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.204.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.203.0 lib/aws-sdk-core/endpoints/reference.rb