AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Class: Aws::Partitions::PartitionList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
gems/aws-partitions/lib/aws-partitions/partition_list.rb

Instance Method Summary collapse

Constructor Details

#initializePartitionList

Returns a new instance of PartitionList.



9
10
11
# File 'gems/aws-partitions/lib/aws-partitions/partition_list.rb', line 9

def initialize
  @partitions = {}
end

Instance Method Details

#each(&block) ⇒ Enumerator<Partition>

Returns:



14
15
16
# File 'gems/aws-partitions/lib/aws-partitions/partition_list.rb', line 14

def each(&block)
  @partitions.each_value(&block)
end

#partition(partition_name) ⇒ Partition

Parameters:

  • partition_name (String)

Returns:



20
21
22
23
24
25
26
27
28
# File 'gems/aws-partitions/lib/aws-partitions/partition_list.rb', line 20

def partition(partition_name)
  if @partitions.key?(partition_name)
    @partitions[partition_name]
  else
    msg = "invalid partition name #{partition_name.inspect}; valid "\
          "partition names include %s" % [@partitions.keys.join(', ')]
    raise ArgumentError, msg
  end
end

#partitionsArray<Partition>

Returns:



31
32
33
# File 'gems/aws-partitions/lib/aws-partitions/partition_list.rb', line 31

def partitions
  @partitions.values
end