You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

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



7
8
9
# File 'gems/aws-partitions/lib/aws-partitions/partition_list.rb', line 7

def initialize
  @partitions = {}
end

Instance Method Details

#each(&block) ⇒ Enumerator<Partition>

Returns:



12
13
14
# File 'gems/aws-partitions/lib/aws-partitions/partition_list.rb', line 12

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

#partition(partition_name) ⇒ Partition

Parameters:

  • partition_name (String)

Returns:



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

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

#partitionsArray<Partition>

Returns:



29
30
31
# File 'gems/aws-partitions/lib/aws-partitions/partition_list.rb', line 29

def partitions
  @partitions.values
end