Class: AWS::EC2::ElasticIpCollection
- Inherits:
-
Collection
- Object
- Collection
- AWS::EC2::ElasticIpCollection
- Defined in:
- lib/aws/ec2/elastic_ip_collection.rb
Instance Method Summary collapse
-
#[](public_ip) ⇒ ElasticIp
The elastic IP with the given address.
- #create ⇒ Object (also: #allocate)
-
#each {|elastic_ip| ... } ⇒ Object
Yields once for each elastic IP address.
Instance Method Details
#[](public_ip) ⇒ ElasticIp
Returns The elastic IP with the given address.
31 32 33 |
# File 'lib/aws/ec2/elastic_ip_collection.rb', line 31 def [] public_ip super end |
#create ⇒ Object Also known as: allocate
22 23 24 25 |
# File 'lib/aws/ec2/elastic_ip_collection.rb', line 22 def create response = client.allocate_address ElasticIp.new(response.public_ip, :config => config) end |
#each {|elastic_ip| ... } ⇒ Object
Yields once for each elastic IP address.
66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/aws/ec2/elastic_ip_collection.rb', line 66 def each &block response = filtered_request(:describe_addresses) response.addresses_set.each do |address| elastic_ip = ElasticIp.new(address.public_ip, :config => config) yield(elastic_ip) end end |