Class: Eipmap::Exporter

Inherits:
Object
  • Object
show all
Defined in:
lib/eipmap/exporter.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ec2, options = {}) ⇒ Exporter

Returns a new instance of Exporter.



6
7
8
9
# File 'lib/eipmap/exporter.rb', line 6

def initialize(ec2, options = {})
  @ec2 = ec2
  @options = options
end

Class Method Details

.export(ec2, options = {}) ⇒ Object



2
3
4
# File 'lib/eipmap/exporter.rb', line 2

def self.export(ec2, options = {})
  self.new(ec2, options).export
end

Instance Method Details

#exportObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/eipmap/exporter.rb', line 11

def export
  result = {}

  @ec2.describe_addresses.each do |response|
    response.addresses.each do |address|
      export_address(address, result)
    end
  end

  return result
end