You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.
Class: AWS::Core::RegionCollection
- Inherits:
-
Object
- Object
- AWS::Core::RegionCollection
- Includes:
- Enumerable
- Defined in:
- lib/aws/core/region_collection.rb
Overview
Provides a mechnasim to discover available regions. This can useful if you want to perform an operation for a service in every region.
# call the EC2 DescribeInstances operation in each region AWS.regions.each do |region| resp = region.ec2.client.describe_instances end
You can also use this collection as a shortcut for creating a service interface with a given region.
s3 = AWS.regions['us-west-1'].s3
This collection enumerates and returns Region objects.
Instance Attribute Summary collapse
-
#config ⇒ Configuration
readonly
Instance Method Summary collapse
-
#[](name) ⇒ Region
Returns a Region with the given name.
-
#each {|Region| ... } ⇒ Object
Enumerates public regions (non US Gov regions).
Instance Attribute Details
#config ⇒ Configuration (readonly)
50 51 52 |
# File 'lib/aws/core/region_collection.rb', line 50 def config @config end |
Instance Method Details
#[](name) ⇒ Region
Returns a AWS::Core::Region with the given name.
54 55 56 |
# File 'lib/aws/core/region_collection.rb', line 54 def [] name Region.new(name, :config => config) end |
#each {|Region| ... } ⇒ Object
Enumerates public regions (non US Gov regions).
60 61 62 63 64 |
# File 'lib/aws/core/region_collection.rb', line 60 def each &block public_regions.each do |region_name| yield(self[region_name]) end end |