Class: Fog::AWS::EC2::Addresses

Inherits:
Collection show all
Defined in:
lib/fog/aws/models/ec2/addresses.rb

Instance Method Summary collapse

Methods inherited from Collection

#initialize, #inspect, #update_attributes

Constructor Details

This class inherits a constructor from Fog::Collection

Instance Method Details

#allObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/fog/aws/models/ec2/addresses.rb', line 11

def all
  data = connection.describe_addresses.body
  addresses = []
  data['addressesSet'].each do |address|
    addresses << Fog::AWS::EC2::Address.new({
      :connection => connection
    }.merge!(address))
  end
  addresses
end

#createObject



22
23
24
25
26
# File 'lib/fog/aws/models/ec2/addresses.rb', line 22

def create
  address = new
  address.save
  address
end

#newObject



28
29
30
# File 'lib/fog/aws/models/ec2/addresses.rb', line 28

def new
  Fog::AWS::S3::Address.new(:connection => connection)
end