Module: Aws::Endpoints::Templater Private

Defined in:
lib/aws-sdk-core/endpoints/templater.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

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.

Class Method Summary collapse

Class Method Details

.resolve(string, parameters, assigns) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



15
16
17
18
19
20
21
22
# File 'lib/aws-sdk-core/endpoints/templater.rb', line 15

def resolve(string, parameters, assigns)
  # scans for strings in curly brackets {}
  string.scan(/\{.+?\}/).each do |capture|
    value = capture[1..-2] # strips curly brackets
    string = string.gsub(capture, replace(value, parameters, assigns))
  end
  string
end