Class: Aws::Endpoints::RuleSet Private
- Inherits:
-
Object
- Object
- Aws::Endpoints::RuleSet
- Defined in:
- lib/aws-sdk-core/endpoints/rule_set.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
- #parameters ⇒ Object readonly private
- #rules ⇒ Object readonly private
- #service_id ⇒ Object readonly private
- #version ⇒ Object readonly private
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(version:, service_id:, parameters:, rules:) ⇒ RuleSet
constructor
private
A new instance of RuleSet.
Constructor Details
#initialize(version:, service_id:, parameters:, rules:) ⇒ RuleSet
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 RuleSet.
12 13 14 15 16 17 |
# File 'lib/aws-sdk-core/endpoints/rule_set.rb', line 12 def initialize(version:, service_id:, parameters:, rules:) @version = version @service_id = service_id @parameters = parameters @rules = RuleSet.rules_from_json(rules || []) end |
Instance Attribute Details
#parameters ⇒ Object (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.
21 22 23 |
# File 'lib/aws-sdk-core/endpoints/rule_set.rb', line 21 def parameters @parameters end |
#rules ⇒ Object (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/rule_set.rb', line 22 def rules @rules end |
#service_id ⇒ Object (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/rule_set.rb', line 20 def service_id @service_id end |
#version ⇒ Object (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/rule_set.rb', line 19 def version @version end |
Class Method Details
.rules_from_json(rules_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.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/aws-sdk-core/endpoints/rule_set.rb', line 24 def self.rules_from_json(rules_json) rules_json.each.with_object([]) do |rule, rules| if rule['type'] == 'endpoint' rules << EndpointRule.new( conditions: rule['conditions'], endpoint: rule['endpoint'], documentation: rule['documentation'] ) elsif rule['type'] == 'error' rules << ErrorRule.new( conditions: rule['conditions'], error: rule['error'], documentation: rule['documentation'] ) elsif rule['type'] == 'tree' rules << TreeRule.new( conditions: rule['conditions'], rules: rule['rules'], documentation: rule['documentation'] ) else # should not happen raise "Unknown endpoint rule type: #{rule}" end end end |