Sha256: c0ba8da34de6a2e59863c15076da2bc7dde988226a0b210e3851e60061b4c4f6

Contents?: true

Size: 934 Bytes

Versions: 77

Compression:

Stored size: 934 Bytes

Contents

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 RulesProvider
      def initialize(rule_set)
        @rule_set = rule_set
      end

      def resolve_endpoint(parameters)
        obj = resolve_rules(parameters)
        case obj
        when Endpoint
          obj
        when ArgumentError
          raise obj
        else
          raise ArgumentError, 'No endpoint could be resolved'
        end
      end

      private

      def resolve_rules(parameters)
        @rule_set.rules.each do |rule|
          output = rule.match(parameters)
          return output if output
        end
        nil
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
aws-sdk-core-3.201.1 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.201.0 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.200.0 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.199.0 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.198.0 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.197.2 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.197.1 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.197.0 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.194.1 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.194.0 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.193.0 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.192.1 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.192.0 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.191.6 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.191.5 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.191.4 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.191.3 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.191.2 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.191.1 lib/aws-sdk-core/endpoints/rules_provider.rb
aws-sdk-core-3.191.0 lib/aws-sdk-core/endpoints/rules_provider.rb