Class: HP::Cloud::Networks

Inherits:
FogCollection show all
Defined in:
lib/hpcloud/networks.rb

Instance Attribute Summary

Attributes inherited from FogCollection

#items, #name

Instance Method Summary collapse

Methods inherited from FogCollection

#empty?, #filter, #get, #get_array, #matches, #unique

Constructor Details

#initializeNetworks

Returns a new instance of Networks.



28
29
30
31
# File 'lib/hpcloud/networks.rb', line 28

def initialize
  super("network")
  @items = @connection.network.networks
end

Instance Method Details

#create(item = nil) ⇒ Object



33
34
35
# File 'lib/hpcloud/networks.rb', line 33

def create(item = nil)
  return NetworkHelper.new(@connection, item)
end

#externalObject



37
38
39
40
41
42
43
44
# File 'lib/hpcloud/networks.rb', line 37

def external
  @items.each{ |n|
    if n.router_external == true
      return create(n)
    end
  }
  return nil
end