Class: Aws::Partitions::Partition
- Inherits:
-
Object
- Object
- Aws::Partitions::Partition
- Defined in:
- gems/aws-partitions/lib/aws-partitions/partition.rb
Instance Attribute Summary collapse
-
#metadata ⇒ Metadata
readonly
The metadata for the partition.
-
#name ⇒ String
readonly
The partition name, e.g.
-
#region_regex ⇒ String
readonly
The regex representing the region format.
Instance Method Summary collapse
-
#region(region_name) ⇒ Region
-
#region?(region_name) ⇒ Boolean
True if the region is in the partition.
-
#regions ⇒ Array<Region>
-
#service(service_name) ⇒ Service
-
#service?(service_name) ⇒ Boolean
True if the service is in the partition.
-
#services ⇒ Array<Service>
Instance Attribute Details
#metadata ⇒ Metadata (readonly)
Returns The metadata for the partition.
25 26 27 |
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 25 def @metadata end |
#name ⇒ String (readonly)
Returns The partition name, e.g. "aws", "aws-cn", "aws-us-gov".
19 20 21 |
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 19 def name @name end |
#region_regex ⇒ String (readonly)
Returns The regex representing the region format.
22 23 24 |
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 22 def region_regex @region_regex end |
Instance Method Details
#region(region_name) ⇒ Region
30 31 32 33 34 35 36 37 38 |
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 30 def region(region_name) if @regions.key?(region_name) @regions[region_name] else msg = "invalid region name #{region_name.inspect}; valid region "\ "names include #{@regions.keys.join(', ')}" raise ArgumentError, msg end end |
#region?(region_name) ⇒ Boolean
Returns true if the region is in the partition.
47 48 49 |
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 47 def region?(region_name) @regions.key?(region_name) end |
#regions ⇒ Array<Region>
41 42 43 |
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 41 def regions @regions.values end |
#service(service_name) ⇒ Service
54 55 56 57 58 59 60 61 62 |
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 54 def service(service_name) if @services.key?(service_name) @services[service_name] else msg = "invalid service name #{service_name.inspect}; valid service "\ "names include #{@services.keys.join(', ')}" raise ArgumentError, msg end end |
#service?(service_name) ⇒ Boolean
Returns true if the service is in the partition.
71 72 73 |
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 71 def service?(service_name) @services.key?(service_name) end |
#services ⇒ Array<Service>
65 66 67 |
# File 'gems/aws-partitions/lib/aws-partitions/partition.rb', line 65 def services @services.values end |