Class: OvirtSDK4::NetworkConfiguration
- Defined in:
- lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb
Instance Method Summary collapse
-
#==(other) ⇒ Object
Returns
true
ifself
andother
have the same attributes and values. -
#dns ⇒ Dns
Returns the value of the
dns
attribute. -
#dns=(value) ⇒ Object
Sets the value of the
dns
attribute. -
#hash ⇒ Object
Generates a hash value for this object.
-
#initialize(opts = {}) ⇒ NetworkConfiguration
constructor
Creates a new instance of the NetworkConfiguration class.
-
#nics ⇒ Array<Nic>
Returns the value of the
nics
attribute. -
#nics=(list) ⇒ Object
Sets the value of the
nics
attribute.
Methods included from Type
Constructor Details
#initialize(opts = {}) ⇒ NetworkConfiguration
Creates a new instance of the OvirtSDK4::NetworkConfiguration class.
11319 11320 11321 11322 11323 |
# File 'lib/ovirtsdk4/types.rb', line 11319 def initialize(opts = {}) super(opts) self.dns = opts[:dns] self.nics = opts[:nics] end |
Instance Method Details
#==(other) ⇒ Object
Returns true
if self
and other
have the same attributes and values.
11328 11329 11330 11331 11332 |
# File 'lib/ovirtsdk4/types.rb', line 11328 def ==(other) super && @dns == other.dns && @nics == other.nics end |
#dns ⇒ Dns
Returns the value of the dns
attribute.
11261 11262 11263 |
# File 'lib/ovirtsdk4/types.rb', line 11261 def dns @dns end |
#dns=(value) ⇒ Object
Sets the value of the dns
attribute.
The value
parameter can be an instance of Dns or a hash.
If it is a hash then a new instance will be created passing the hash as the
opts
parameter to the constructor.
11274 11275 11276 11277 11278 11279 |
# File 'lib/ovirtsdk4/types.rb', line 11274 def dns=(value) if value.is_a?(Hash) value = Dns.new(value) end @dns = value end |
#hash ⇒ Object
Generates a hash value for this object.
11337 11338 11339 11340 11341 |
# File 'lib/ovirtsdk4/types.rb', line 11337 def hash super + @dns.hash + @nics.hash end |
#nics ⇒ Array<Nic>
Returns the value of the nics
attribute.
11286 11287 11288 |
# File 'lib/ovirtsdk4/types.rb', line 11286 def nics @nics end |
#nics=(list) ⇒ Object
Sets the value of the nics
attribute.
11295 11296 11297 11298 11299 11300 11301 11302 11303 11304 11305 |
# File 'lib/ovirtsdk4/types.rb', line 11295 def nics=(list) if list.class == Array list = List.new(list) list.each_with_index do |value, index| if value.is_a?(Hash) list[index] = Nic.new(value) end end end @nics = list end |