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.

Parameters:

  • opts (Hash) (defaults to: {})

    A hash containing the attributes of the object. The keys of the hash should be symbols corresponding to the names of the attributes. The values of the hash should be the values of the attributes.

Options Hash (opts):

  • :assignment_method (BootProtocol)

    The value of attribute assignment_method.

  • :ip (Ip, Hash)

    The value of attribute ip.


6673
6674
6675
6676
6677
# File 'lib/ovirtsdk4/types.rb', line 6673

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.


6682
6683
6684
6685
6686
# File 'lib/ovirtsdk4/types.rb', line 6682

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

#assignment_methodBootProtocol

Returns the value of the assignment_method attribute.

Returns:


6623
6624
6625
# File 'lib/ovirtsdk4/types.rb', line 6623

def assignment_method
  @assignment_method
end

#assignment_method=(value) ⇒ Object

Sets the value of the assignment_method attribute.

Parameters:


6632
6633
6634
# File 'lib/ovirtsdk4/types.rb', line 6632

def assignment_method=(value)
  @assignment_method = value
end

#hashObject

Generates a hash value for this object.


6691
6692
6693
6694
6695
# File 'lib/ovirtsdk4/types.rb', line 6691

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

#ipIp

Returns the value of the ip attribute.

Returns:


6641
6642
6643
# File 'lib/ovirtsdk4/types.rb', line 6641

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.

Parameters:

  • value (Ip, Hash)

6654
6655
6656
6657
6658
6659
# File 'lib/ovirtsdk4/types.rb', line 6654

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