Class: Fog::Vcloud::Terremark::Ecloud::Network

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/vcloud/terremark/ecloud/models/network.rb

Instance Attribute Summary

Attributes inherited from Model

#loaded

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#load_unless_loaded!

Methods inherited from Model

#initialize, #inspect, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #identity, #identity=, #merge_attributes, #new_record?, #requires

Constructor Details

This class inherits a constructor from Fog::Model

Instance Method Details

#ipsObject



25
26
27
28
29
30
# File 'lib/fog/vcloud/terremark/ecloud/models/network.rb', line 25

def ips
  load_unless_loaded!
  @ips ||= Fog::Vcloud::Terremark::Ecloud::Ips.
    new( :connection => connection,
         :href => links.detect { |link| link[:name] == "IP Addresses" }[:href] )
end

#reloadObject



44
45
46
47
48
# File 'lib/fog/vcloud/terremark/ecloud/models/network.rb', line 44

def reload
  super
  merge_attributes(extension_data.body)
  self
end

#rnat=(new_rnat) ⇒ Object



32
33
34
35
# File 'lib/fog/vcloud/terremark/ecloud/models/network.rb', line 32

def rnat=(new_rnat)
  attributes[:rnat] = new_rnat
  @changed = true
end

#saveObject



37
38
39
40
41
42
# File 'lib/fog/vcloud/terremark/ecloud/models/network.rb', line 37

def save
  if @changed
    connection.configure_network( extension_href, _compose_network_data )
  end
  true
end