Module: Aws::Partitions::Metadata Private
- Defined in:
- lib/aws-partitions/metadata.rb
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.
Class Method Summary collapse
- .default_partition_metadata ⇒ Object private
-
.partition(region) ⇒ Object
private
aws.partition(region: string) Option<Partition>.
- .partitions ⇒ Object private
Class Method Details
.default_partition_metadata ⇒ 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.
25 26 27 28 |
# File 'lib/aws-partitions/metadata.rb', line 25 def path = File.('../../../partitions-metadata.json', __FILE__) JSON.parse(File.read(path), freeze: true)['partitions'] end |
.partition(region) ⇒ 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.
aws.partition(region: string) Option<Partition>
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/aws-partitions/metadata.rb', line 10 def partition(region) partition = partitions.find { |p| p['regions']&.fetch(region, nil) } || partitions.find { |p| region.match(p['regionRegex']) } || partitions.find { |p| p['id'] == 'aws' } return nil unless partition partition['outputs'] end |
.partitions ⇒ 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.
21 22 23 |
# File 'lib/aws-partitions/metadata.rb', line 21 def partitions @partitions ||= end |