Class: Vcloud::Core::EdgeGatewayInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/vcloud/core/edge_gateway_interface.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gateway_interface_hash) ⇒ EdgeGatewayInterface

Returns a new instance of EdgeGatewayInterface.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 7

def initialize(gateway_interface_hash)
  raise "Argument error: nil not allowed" if gateway_interface_hash.nil?
  @vcloud_gateway_interface = gateway_interface_hash
  unless @name = gateway_interface_hash[:Name]
    raise "Argument error: must have a :Name"
  end
  unless network_section = gateway_interface_hash[:Network]
    raise "Argument error: must have a :Network section"
  end
  unless @network_href = network_section[:href]
    raise "Argument error: must have a :Network[:href]"
  end
  unless @network_name = network_section[:name]
    raise "Argument error: must have a :Network[:name]"
  end
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 5

def name
  @name
end

#network_hrefObject

Returns the value of attribute network_href.



5
6
7
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 5

def network_href
  @network_href
end

#network_nameObject

Returns the value of attribute network_name.



5
6
7
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 5

def network_name
  @network_name
end

Instance Method Details

#network_idObject



24
25
26
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 24

def network_id
  network_href.split('/').last
end