Class: Aws::Endpoints::Condition Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-core/endpoints/condition.rb

Overview

This class is part of a private API. You should avoid using this class 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.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fn:, argv:, assign: nil) ⇒ Condition

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.

Returns a new instance of Condition.



12
13
14
15
16
# 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

Instance Attribute Details

#argvObject (readonly)

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.



19
20
21
# File 'lib/aws-sdk-core/endpoints/condition.rb', line 19

def argv
  @argv
end

#assignObject (readonly)

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.



20
21
22
# File 'lib/aws-sdk-core/endpoints/condition.rb', line 20

def assign
  @assign
end

#assignedObject (readonly)

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.



22
23
24
# File 'lib/aws-sdk-core/endpoints/condition.rb', line 22

def assigned
  @assigned
end

#fnObject (readonly)

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.



18
19
20
# File 'lib/aws-sdk-core/endpoints/condition.rb', line 18

def fn
  @fn
end

Class Method Details

.from_json(conditions_json) ⇒ 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.



30
31
32
33
34
35
36
37
38
# 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

Instance Method Details

#match?(parameters, assigns) ⇒ Boolean

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.

Returns:

  • (Boolean)


24
25
26
27
28
# 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