Class: OvirtSDK4::IpAddressAssignment

Inherits:
Struct
  • Object
show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ IpAddressAssignment

Creates a new instance of the OvirtSDK4::IpAddressAssignment class.

Options Hash (opts):

  • :assignment_method (BootProtocol)

    The value of attribute assignment_method.

  • :ip (Ip, Hash)

    The value of attribute ip.



7307
7308
7309
7310
7311
# File 'lib/ovirtsdk4/types.rb', line 7307

def initialize(opts = {})
  super(opts)
  self.assignment_method = opts[:assignment_method]
  self.ip = opts[:ip]
end

Instance Method Details

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.



7316
7317
7318
7319
7320
# File 'lib/ovirtsdk4/types.rb', line 7316

def ==(other)
  super &&
  @assignment_method == other.assignment_method &&
  @ip == other.ip
end

#assignment_methodBootProtocol

Returns the value of the assignment_method attribute.



7257
7258
7259
# File 'lib/ovirtsdk4/types.rb', line 7257

def assignment_method
  @assignment_method
end

#assignment_method=(value) ⇒ Object

Sets the value of the assignment_method attribute.



7266
7267
7268
# File 'lib/ovirtsdk4/types.rb', line 7266

def assignment_method=(value)
  @assignment_method = value
end

#hashObject

Generates a hash value for this object.



7325
7326
7327
7328
7329
# File 'lib/ovirtsdk4/types.rb', line 7325

def hash
  super +
  @assignment_method.hash +
  @ip.hash
end

#ipIp

Returns the value of the ip attribute.



7275
7276
7277
# File 'lib/ovirtsdk4/types.rb', line 7275

def ip
  @ip
end

#ip=(value) ⇒ Object

Sets the value of the ip attribute.

The value parameter can be an instance of OvirtSDK4::Ip 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.



7288
7289
7290
7291
7292
7293
# File 'lib/ovirtsdk4/types.rb', line 7288

def ip=(value)
  if value.is_a?(Hash)
    value = Ip.new(value)
  end
  @ip = value
end