Class: Aws::Partitions::Partition
- Inherits:
-
Object
- Object
- Aws::Partitions::Partition
- Defined in:
- lib/aws-sdk-core/partitions/partition.rb
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
The partition name, e.g.
Class Method Summary collapse
- .build(partition) ⇒ Object private
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Partition
constructor
private
A new instance of Partition.
- #region(region_name) ⇒ Region
- #regions ⇒ Array<Region>
- #service(service_name) ⇒ Service
- #services ⇒ Array<Service>
Constructor Details
#initialize(options = {}) ⇒ Partition
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 Partition.
9 10 11 12 13 |
# File 'lib/aws-sdk-core/partitions/partition.rb', line 9 def initialize( = {}) @name = [:name] @regions = [:regions] @services = [:services] end |
Instance Attribute Details
#name ⇒ String (readonly)
Returns The partition name, e.g. “aws”, “aws-cn”, “aws-us-gov”.
16 17 18 |
# File 'lib/aws-sdk-core/partitions/partition.rb', line 16 def name @name end |
Class Method Details
.build(partition) ⇒ 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.
57 58 59 60 61 62 63 |
# File 'lib/aws-sdk-core/partitions/partition.rb', line 57 def build(partition) Partition.new( name: partition['partition'], regions: build_regions(partition), services: build_services(partition), ) end |
Instance Method Details
#region(region_name) ⇒ Region
21 22 23 24 25 26 27 28 29 |
# File 'lib/aws-sdk-core/partitions/partition.rb', line 21 def region(region_name) if @regions.key?(region_name) @regions[region_name] else msg = "invalid region name #{region_name.inspect}; valid region " msg << "names include %s" % [@regions.keys.join(', ')] raise ArgumentError, msg end end |
#regions ⇒ Array<Region>
32 33 34 |
# File 'lib/aws-sdk-core/partitions/partition.rb', line 32 def regions @regions.values end |
#service(service_name) ⇒ Service
39 40 41 42 43 44 45 46 47 |
# File 'lib/aws-sdk-core/partitions/partition.rb', line 39 def service(service_name) if @services.key?(service_name) @services[service_name] else msg = "invalid service name #{service_name.inspect}; valid service " msg << "names include %s" % [@services.keys.join(', ')] raise ArgumentError, msg end end |
#services ⇒ Array<Service>
50 51 52 |
# File 'lib/aws-sdk-core/partitions/partition.rb', line 50 def services @services.values end |