class AWS::EC2::RegionCollection

Represents all the regions available to your account.

@example Getting a map of endpoints by region name

ec2.regions.inject({}) { |m, r| m[r.name] = r.endpoint; m }

Public Instance Methods

[](name) click to toggle source

@return [Region] The region identified by the given name

(e.g. "us-east-1").
# File lib/aws/ec2/region_collection.rb, line 38
def [](name)
  super
end
each() { |region| ... } click to toggle source

@yield [Region] Each region that is available to your account. @return [nil]

# File lib/aws/ec2/region_collection.rb, line 25
def each
  response = filtered_request(:describe_regions)
  response.region_info.each do |r|
    region = Region.new(r.region_name,
                        :endpoint => r.region_endpoint,
                        :config => config)
    yield(region)
  end
  nil
end

Protected Instance Methods

member_class() click to toggle source

@private

# File lib/aws/ec2/region_collection.rb, line 44
def member_class
  Region
end