class Aws::Endpoints::Condition

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

Attributes

argv[R]
assign[R]
assigned[R]
fn[R]

Public Class Methods

from_json(conditions_json) click to toggle source
# File lib/aws-sdk-core/endpoints/condition.rb, line 30
def self.from_json(conditions_json)
  conditions_json.each.with_object([]) do |condition, conditions|
    conditions << new(
      fn: condition['fn'],
      argv: condition['argv'],
      assign: condition['assign']
    )
  end
end
new(fn:, argv:, assign: nil) click to toggle source
# File lib/aws-sdk-core/endpoints/condition.rb, line 12
def initialize(fn:, argv:, assign: nil)
  @fn = Function.new(fn: fn, argv: argv)
  @assign = assign
  @assigned = {}
end

Public Instance Methods

match?(parameters, assigns) click to toggle source
# File lib/aws-sdk-core/endpoints/condition.rb, line 24
def match?(parameters, assigns)
  output = @fn.call(parameters, assigns)
  @assigned = @assigned.merge({ @assign => output }) if @assign
  output
end