Class: Vcloud::Core::EdgeGatewayInterface
- Inherits:
-
Object
- Object
- Vcloud::Core::EdgeGatewayInterface
- Defined in:
- lib/vcloud/core/edge_gateway_interface.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#network_href ⇒ Object
Returns the value of attribute network_href.
-
#network_name ⇒ Object
Returns the value of attribute network_name.
Instance Method Summary collapse
-
#initialize(gateway_interface_hash) ⇒ Vcloud::Core::EdgeGatewayInterface
constructor
Return a new instance of an EdgeGatewayInterface.
-
#network_id ⇒ String
Get the ID of EdgeGatewayInterface from the @network_href.
Constructor Details
#initialize(gateway_interface_hash) ⇒ Vcloud::Core::EdgeGatewayInterface
Return a new instance of an EdgeGatewayInterface
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 11 def initialize(gateway_interface_hash) if gateway_interface_hash.nil? raise "EdgeGatewayInterface: gateway_interface_hash cannot be nil" end unless gateway_interface_hash[:Name] && gateway_interface_hash[:Network] raise "EdgeGatewayInterface: bad input: #{gateway_interface_hash}" end @vcloud_gateway_interface = gateway_interface_hash @name = gateway_interface_hash[:Name] @network_href = gateway_interface_hash[:Network][:href] @network_name = gateway_interface_hash[:Network][:name] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 5 def name @name end |
#network_href ⇒ Object
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_name ⇒ Object
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_id ⇒ String
Get the ID of EdgeGatewayInterface from the @network_href
27 28 29 |
# File 'lib/vcloud/core/edge_gateway_interface.rb', line 27 def network_id network_href.split('/').last end |