class AWS::EC2::ElasticIpCollection

Public Instance Methods

[](public_ip) click to toggle source

@param [String] public_ip The public IP address of an elastic ip. @return [ElasticIp] The elastic IP with the given address.

# File lib/aws/ec2/elastic_ip_collection.rb, line 27
def [] public_ip
  super
end
allocate() click to toggle source
Alias for: create
create() click to toggle source
# File lib/aws/ec2/elastic_ip_collection.rb, line 18
def create 
  response = client.allocate_address
  ElasticIp.new(response.public_ip, :config => config)
end
Also aliased as: allocate
each() { |elastic_ip| ... } click to toggle source

Yields once for each elastic IP address.

@yield [elastic_ip] @yieldparam [ElasticIp] elastic_ip

# File lib/aws/ec2/elastic_ip_collection.rb, line 62
def each &block
  response = filtered_request(:describe_addresses)
  response.addresses_set.each do |address|

    options = {}
    options[:config] = config
    options[:instance_id] = address.instance_id

    elastic_ip = ElasticIp.new(address.public_ip, options)

    yield(elastic_ip)

  end
end

Protected Instance Methods

member_class() click to toggle source
# File lib/aws/ec2/elastic_ip_collection.rb, line 78
def member_class
  ElasticIp
end