Sha256: 92f79fd9a9898f08afd967da28c52ce4a830c780e87c8120cea4048872d58c73

Contents?: true

Size: 608 Bytes

Versions: 9

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true

module Aws
  module Endpoints
    # @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

9 entries across 9 versions & 1 rubygems

Version Path
aws-sdk-core-3.168.4 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.168.3 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.168.2 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.168.1 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.168.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.167.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.166.0 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.165.1 lib/aws-sdk-core/endpoints/reference.rb
aws-sdk-core-3.165.0 lib/aws-sdk-core/endpoints/reference.rb